wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FP2: 02 - STRINGS

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

¿Cuál es la longitud de la siguiente cadena asumiendo que no hay espacios en blanco entre las comillas?

'''

'''

a)

0

b)

1

c)

6

d)

7

2.

alpha = "abdefg"
print(alpha[3:-2])

(a)  

3.

print(min("aAbByYzZ"))

(a)  

4.

str = "abcabc"

str.count("b")

a)

6

b)

2

c)

0

d)

No se imprime nada

5.

print(len("\n\n"))

a)

ValueError

b)

4

c)

2

d)

0

6.

print('kappa'.find('a', 2, 4))

a)

1

b)

4

c)

Exception

d)

-1

7.

str = "Hola Mundo 2023"

print(str.isalnum())

¿que imprime?

a)

True

b)

False

c)

Exception

d)

Hola Mundo 2023

8.

print("www.cisco.com".lstrip("w."))

¿Que imprime?

a)

www.cisco.com

b)

wwcisco.com

c)

cisco.com

d)

.cisco.com

9.

print("This is it!".replace("is", "are", 1))

¿que imprime?

a)

This is it!

b)

There are it!

c)

Thare is it!

d)

This are it!

10.

'smith' > 'Smith'

'Smiths' < 'Smith'

'Smith' > '1000'

'11' < '8'

a)

True

False

True

False

b)

True

True

False

True

c)

False

False

True

False

d)

False

True

False

True