This file contains hidden or 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
#For Loop with Lists | |
fruits = ["Apple", "Peach", "Pear"] | |
for fruit in fruits: | |
print(fruit) | |
print(fruit + " Pie") | |
print(fruits) |
This file contains hidden or 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
import random | |
randomInteger = random.randint(1, 10) | |
print(randomInteger) | |
randomFloat = random.random() * 5 | |
print(randomFloat) | |
love_score = random.randint(1, 100) | |
print(f"Your love score is {love_score}") |
This file contains hidden or 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 rollercoaster!") | |
height = int(input("What is your height in cm? ")) | |
if height >= 120: | |
print("You can ride the rollercoaster!") | |
else: | |
print("Sorry, you have to grow taller before you can ride. ") |
This file contains hidden or 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
#Data Types | |
#String | |
"Hello"[4] | |
print("123" + "345") | |
#Integer |
This file contains hidden or 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!") |