Lesson 2
Why repeat manually when you can for loop
Variable substitution
Take an input instead of hard code
sentence_mon = "I will never win an enemy"
sentence_tues = "I will be nice"
repeat = input("how many times : ")
for i in range(int(repeat)):
print(sentence_mon)
Printing $ 5 times
Homework
Input
how many $ would you like? :
Code
- Take an input from the terminal
- Using the code from above substitue 5 with the input value
- Make as many mistakes as you like
- Don't give up
Output $$$$$$