Days_8 Affirmation Generator
Ari Wira Saputra
Posted on March 19, 2023
Today's focus is using all the skills you have learned so far:
input and output
concatenation
if statements
nested if statements
Build a custom affirmations generator to give the user a customized affirmation each day of the week.
#Nesting Dolls Code
#
#19 MARCH 2023
def exercise_1():
activity=input("What are you doing in sunday? ")
if activity.lower() == "joging":
print(activity.capitalize(),"is healthy lifestyle!!!.")
Where =input("Where do you joging? ")
if Where == "Hi":
print(activity.capitalize(),"in",Where,"a great place!!!")
else:
print("interesting place")
elif activity.lower() == "sleep":
print(activity.capitalize(),"bad habits!!!")
else:
print("have a nice day")
def call():
exercise_1()
call()
The final challenge is to create if statements that do not care about the capitalization of the names entered by the user.
💖 💪 🙅 🚩
Ari Wira Saputra
Posted on March 19, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024