Python
Simple if questions
1. Check given number is even
2. Check given number is odd (n%2==1 or n%2!==0)
3. Check given character is vowel (a in 'aeiouAEIOU')
4. Check given character is consonant (a not in 'aeiouAEIOU')
5. Check given character is digit ('0'<=a<='9')
6. Check given datatype is mutable (type(a) in [list, set, dict])
7. Check given datatype is SVDT (type(a) in [int, float, complex, bool])
8. Check given 2 values are pointing to same reference address (a is b)
9. Check given string starts with 'p' without using inbuilt methods a[0]=='p'
10. Check the last digit is 5 n%10==5
11. Check given element is fruit a in fruit
12. Check given character is uppercase alphabet 'A'<=a<='Z'
13. Check given string is palindrome a==a[::-1]
14. Check the input number is multiple of 7 n%7==0
15. Check the last value of list is '10' l[-1]=='10'
16. Check given collection has middle value len(a)%2!=0
17. Check given character is lowercase alphabet
18. Check given string is email
19. Check given mobile number is valid
20. Check user's birthday is in march
21. Check if user is eligible to vote
22. Check given number is positive
23. Write a program to print its sunny day if temperature is more than 28
24. WAP to provide discount for shopping more than 25000
25. Check leap year for the given input
26. bank balance unable to withdraw if balance is less than 1000
27. mobile battery warning if charging is less than 20%
28. movie ticket free for children's
29. wi-fi connectivity check
30. rain alarm alert if it is cloudy day
31. student is pass
32. driving licence eligibility
33. library book return with fine for 1 rupees extra per day for more than a week
34. attendance requirement checks for providing certificate
35. reading mode activate in mobile from 7:00 PM
36. free delivery for shopping more than 1000 rupees on Zomato
37. free gym for children’s less than 20 years
38. mobile data warning if user uses more than 1 GB
39. positive or negative number
40. check user is entering valid username or invalid username
41. check person is eligible to vote or not in terms of age
42. student is eligible to take admission for next semester or not depending on no. of backlogs
43. check whether current year is leap year or not depending on no. of days
44. consider a tuple of length 2, check whether it is homogeneous or heterogeneous tuple
45. greatest of 2 numbers
46. if electricity usage is up to 100 units, bill is free. otherwise, 4 rupees per unit, calculate total
bill after usage
47. a theatre charges for the user above age 12, 200 per person and otherwise it is free.
calculate the bill to be paid by user
48. a person is eligible to donate blood if their age is more than 18 and weight more than 50.
Check whether a person can donate blood or take the blood
49. Ask the user for their monthly expenses and income, check he is in loss or profit
50. a toll gate allows free passage for emergency vehicles (ambulance, fire truck, police). Ask the
user for their vehicle type and determine if they need to pay the toll
51. A restaurant offers a 20% discount if the total bill is above 1000, WAP to calculate the total
bill
52. check given number is divisible by both 3 and 7
53. calculate the total fine by paid by the rider for the police mama if speed is more than 60
(every 5 KMPH, 100 rupees extra)
54. WAP to check whether character is alphabet or not
55. print 'welcome to programming' if student has mock ratings 1 or 1*, otherwise tell him to be
perfect first with the basics.
56. check given string is palindrome or not
57. check whether both the values pointing to different reference address or same
58. check given value is mutable datatype or immutable
59. check whether collection has middle value or not
60. WAP to check given age of a person has to pay ticket for bus or not. (more than 6 age has to
take ticket)