Python programming quizes
What does this commandline print?
>>> a = "Python is cool"
>>> print(a[4])
- 0
- P
- n
- h
What does this commandline print?
>>> a = "Python is cool"
>>> print(a[7:])
- cool
- Python i
- Python is
- is cool
What does this commandline print?
>>> a = "Python is cool"
>>> print(a[:6])
- Python is
- Pytho
- Python
- is cool
What does this commandline print
>>> print("Holberton school")
- Holberton school
- Holberton
- "Holberton school"
- 'Holberton school'
What does this commandline print?
>>> print(f"{98} Battery street")
- 9 Battery street
- 98 Battery street
- f"98 Battery street"
- 8 Battery street
Who created Python?
- Guido van Rossum
- Julien Babier
- Yukihiro Matsumoto
What does this commandline print"
>>> a = "Python is cool"
>>> print(a[-2])
- o
- ol
- l
- Nothing
What does this commandline print?
>>> a = "Python is cool"
>>> print(a[0:6])
- Python is
- Python
- Pytho
- Python is cool
What does this commandline print?
>>> a = "Python is cool"
>>> print(a[7:-5])
- Python
- nohtyP
- on
- is
- si
What does this commandline print?
>>> print(f"{98} Battery street, {'San Francisco'}")
- 98 Battery street, San Francisco
- “98 Battery street, San Francisco”
- 8 Battery street, San
- San Francisco Battery street, 98
