Skip to content

Instantly share code, notes, and snippets.

@under-script
Last active March 31, 2024 13:13
Show Gist options
  • Save under-script/d3f6e3b9f81bf452c028e55d9180a157 to your computer and use it in GitHub Desktop.
Save under-script/d3f6e3b9f81bf452c028e55d9180a157 to your computer and use it in GitHub Desktop.
Day 1 - Beginner - Working with Variables in Python to Manage Data
print("A 'single quote' inside a double quote")
print('A "double quote" inside a single quote')
print("Alternatively you can just \"escape\" the quote")
print("Day 1 - String Manipulation")
print('String Concatenation is done with the "+" sign.')
print('e.g. print("Hello " + "world")')
print("New lines can be created with a backslash and n.")
print("Hello" + input("What's your name? "))
name = "Jack"
print(name)
name = "Angela"
print(name)
name = input("What is your name?")
length = len(name)
print(length)
# There are two variables, a and b
a = input()
b = input()
# Create a third variable to help switch the values
c = a
a = b
b = c
print("a: " + a)
print("b: " + b)
print("Welcome to the Band Name Generator.")
street = input("What's the name of the city you grew up in?\n")
pet = input("What's your pet's name?\n")
print("Your band name could be " + street + " " + pet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment