Skip to content

Instantly share code, notes, and snippets.

@chicagowebmanagement
Last active March 28, 2019 20:20
Show Gist options
  • Save chicagowebmanagement/d31f529d8281f917b9b40f357a0b04a0 to your computer and use it in GitHub Desktop.
Save chicagowebmanagement/d31f529d8281f917b9b40f357a0b04a0 to your computer and use it in GitHub Desktop.
collect two strings and format them
"""
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