Created
September 16, 2020 20:19
-
-
Save calthoff/3f6daff256b7e0053743e89de5a8ff2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exercise 1 | |
for c in "Camus": | |
print(c) | |
# exercise 2 | |
print("aldous was born in 1894.".capitalize()) | |
# exercise 3 | |
print("Where now? Who now? When now?".split('?')) | |
# exercise 4 | |
print(' '.join(["The", "fox", "jumped", "over", "the", "fence", "."])) | |
# exercise 5 | |
print("three" + "three" + "three") | |
print("three" * 3) |
Ex-3
print("Where now? Who now? When now?".split(',')) - This prints the string as is, not sure why we did .split('?)?
print("Where now? Who now? When now?".split('?'))
Hi Sir, this is my code for exercise 3
list = "Where now? Who now? When now?".split('?') print(list)
but why do I get an extra blank index (3)?
['Where now', ' Who now', ' When now', '']
Did you got the answer?
I am having same problem.
to the ones still in this course and struggling like me in ex 3 just add equals sign then print it
print3 = ("three" "three" "three")
print(print3)
multiplyinto3 = ("three" * 3)
print(multiplyinto3)
I like playing with it so I tried to change it and its still good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Sir, this is my code for exercise 3
list = "Where now? Who now? When now?".split('?') print(list)
but why do I get an extra blank index (3)?
['Where now', ' Who now', ' When now', '']