Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 35 páginas
Examen

Python C859 2023 wit complete solution

Document preview thumbnail
Vista previa 4 fuera de 35 páginas

Python C859 2023 wit complete solution

Vista previa del contenido

Python C859
count(x)

Minimum field width with using in operator to check if a
strings character or substring is contained
in the string


Conversion flags



precision
components(Rounding)




.replace()




.find(x)



find(x, start)

find(x, start,

end)


rfind(x)




1/

, Python C859
print('Student name (%5s)' % Same as find but searches the
'Bob' string in reverse, returning the last
the 5 specifies that there are a occurrence in the string
minimum of 5 characters and thus Returns the number of times x
the print out would be ( Bob) occurs in the string
alter the output of conversion
specifiers if 'b' in my_string
%08d adds leading zeros to
the mini- mum width of 8
characters
Indicates how many digits to the
right of the decimal should be
included
'%.1f' % 1.725 indicates a
precision of 1 resulting in 1.7
replace(old,new,count)
count replaces only the first
occurrence count can be left out
translation =
translation.replace('one', 'uno')
Returns the position of the first
occur- rence of item x in the
string
if my_str is 'Boo
Hoo!'
my_str.find('!')
Returns 7
my-str.find('Boo') Returns 0
my_str.find('oo') returns 1
Same as find(x) but begins the
search at position start
Same as find(x,start) but
stops the search at position
end



2/

, ()

startswith(x) endswith(x)

capitalize()


Comparing lower()
Strings




isalnum()


isdigit(

)

islower(

)

isupper

()

isspace


3/

, may be
compared Do not use identity operators
using where you should be using an
relational oper- equality operator
ators (<> <=
etc..) comparisons are case sensitive
equality Returns True if all characters int he
operator string are lowercase or uppercase
s (==,! letters, or the numbers 0-9
=)
member Returns True if all characters
ship are the numbers 0-9
operator Returns True if all characters are
s (in,not lower- case letters
in)
Returns True if all characters are
identity
upper- case letters
operator
s (is, is Returns True if all characters are
not) white- space
my_str = Returns True if the string starts
'Hello'
my_str == with x Returns True if the string
'Hello" ends with x
evaluates to
Returns a copy of the string with
True
the first character capitalized and
rest lower- cased
relational
comparison will Returns a copy of the string with
compare the all char- acters lowercased
ASCII unicode
values. if a
string is short-
er with all the
same
characters
then the
shorter is
considered less
than
4/

Información del documento

Subido en
8 de julio de 2023
Número de páginas
35
Escrito en
2022/2023
Tipo
Examen
Contiene
Preguntas y respuestas
$8.59

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
3
Seguidores
1
Artículos
327
Última venta
5 meses hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes