Python Programming/Creating Python programs/Solutions
From Wikibooks, open books for an open world
1. Modify the hello.py program to say hello to a historical political leader (or to Ada Lovelace).
This is just a matter of replacing world with a different name, for example:
print("Hello, Ada!")
2. Change the program so that after the greeting, it asks, "How did you get here?".
This can be accomplished by adding a second print statement:
print("Hello, Ada!") print("How did you get here?")
3. Re-write the original program to use two print statements: one for "Hello" and one for "world". The program should still only print out on one line.
This can be accomplished by passing the end parameter in the first print statement, and telling it to finish the output with a space.
print ("Hello,", end=" " ) print ("world!")