back
Py Home Work
Python Practice Problems
If Else
- Compute Indian income tax rate for given annual salary 1 a. [4-8 -> 5%, 8-12 -> 10%, 12-16 -> 15%, 16-20 -> 20%, 20-24 -> 25%, above 24 -> 30%]
- Given a metal name (gold, silver, platinum), print their price
- Given a number, if odd double it (2x), if even return same. 3 -> 6, 4 -> 4
- Given two numbers find min
- Given two number find max
- Given number, print day of the week 1 -> Monday 7 -> Sunday
- Given exam scores ex [50, 23, 36, 45, 30] check if user failed or passed an exam. Pass score 36
- Given an number, print whether given number is positive, negative or zero
- Given room temperature, print whether it is Normal, Hot or Cold
- 21-24 Normal
- Above 24 Hot
- Below 21 Cold
- Given age check if user can vote. min age 18
- Given age check if user can drive min age 18
- Given mark check if user fail. pass mark 36
- Given mark check if user scored centum (100)
- Given body temperature check if user has fever (more than 100)
- Given user name, password print ‘success’ if they match ‘admin’, ‘1234’
- Given a number, print ‘positive’, ‘negative’ or ‘zero’
- Check if given number is divisible by 3 and 5
- Check if a candidate is eligible to appear for a role with age limit 21-32
- Given a day check if it falls on week end (sat/sun)
- Given a color name check if it is primary color (Red/Green/Blue)