Last active
March 31, 2024 13:13
-
-
Save under-script/d3f6e3b9f81bf452c028e55d9180a157 to your computer and use it in GitHub Desktop.
Day 1 - Beginner - Working with Variables in Python to Manage Data
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
print("Hello World!") |
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
print("A 'single quote' inside a double quote") | |
print('A "double quote" inside a single quote') | |
print("Alternatively you can just \"escape\" the quote") |
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
print("Hello" + " " + "Angela") |
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
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.") |
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
print("Hello" + input("What's your name? ")) |
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
print(len(input())) |
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
name = "Jack" | |
print(name) | |
name = "Angela" | |
print(name) | |
name = input("What is your name?") | |
length = len(name) | |
print(length) |
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
# 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) |
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
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