0
Do you have practice problems for conditions?
Please give me some practice problems to master conditions in python. Thank you.
2 Answers
0
#Even or Odd Number
- Input a number. Print "Odd" if number is odd and print "Even if number is even
#Young or Old
- Input a number(age). Prints "young" if age is below for example 20. Prints "old" if age is more than 20.
#Coin flip
- Input 0 or 1. Code will generate random number(either 0 or 1). If the generated number is 0 print "head". If the generated is 1 print "tail". Also print if you win or lose if your input matches the generated number
0
Easy
#absolute value
Medium
#number of vowels in a string
Harder
#does string have substring x