Last active
March 28, 2019 20:20
-
-
Save chicagowebmanagement/d31f529d8281f917b9b40f357a0b04a0 to your computer and use it in GitHub Desktop.
collect two strings and format them
This file contains 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
""" | |
Author: Patrick Elward | |
Date: 03/27/2019 | |
Write a program that collects two strings from a user, | |
inserts them into the string "Yesterday I wrote a [response_one]. I sent it to [response_ two]!" and prints a new string. | |
""" | |
x=input("Give me a response: ") | |
y=input("Give me another response: ") | |
z="Yesterday I wrote a {}. I sent it to {}!".format(x,y) | |
print(z) | |
""" | |
Take the string "Where now? Who now? When now?" and call a method that returns a list that looks like: ["Where now?", "Who now?", "When now?"]. | |
""" | |
x="Hey Now? Who Now? Where Now?" | |
y=x.split("? ") | |
print(x) | |
print(y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment