RESOURCES: Class slides: https://docs.google.com/presentation/d/1zIPSvXFg7eEVjguovCNHKpuojvqCq6eA5tjJpfGnSKc/edit?usp=sharing
Coding platform: replit.com
Discord: https://discord.gg/FKKAcmrr
HOMEWORK:
Give 3 examples of each data type (2 examples for Booleans).
Take user input and tell an interactive story using f-strings and concatenation of variables and print statements.
Example of a starting point:
username = input(“What is your name?”)
print(username + “, you know my name, not my story”)
Post your answers as a comment! Solutions will be posted later.
Feel free to email shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) if you're stuck or have questions! See you next class :)
username = input("What is your name? ")
print("Well " + username + ". You may think you know me very well but you haven't heard my crazy story before.")
usertime = input("What time is it? ")
print("It was " + usertime + " when I had witnessed something crazy happen.")
userfriend = input("What is your friend's name? ")
print("I was just strolling in the woods with " + userfriend + " when I heard sirens in the woods. I walked in the woods but there was nothing.")
useranimal = input("What animal is your pet?")
useranimalname = input("What is your pet's name? ")
print(userfriend + " was cold and hungry and wanted to go but I decided to investigate. I saw a shadow that looked like a " + useranimal + " and I was pretty sure it was " + useranimalname)
useranimalscared = input("What animal are you scared of?")
print("If you were there though, you would think it was " + useranimalscared + " and ran away and wet your pants")
usernaturaldisastor = input("What natural disastor happened?")
userfavoritecolor = input("What is your favorite color?")
print("All of a sudden, a " + usernaturaldisastor + " started and I knew I had to get out of there. The funny thing is, I saw a " + userfavoritecolor + " beam of light in the sky and " + useranimalname + " coming out of it. " + userfriend + " wonders if it was you, but hey, we can never know.")