Assignment/Task 1
Hint: Python If Condition
1. We are having 3 list like this
Colors = [“Yellow”,”Green”,”White”,”Black”]
Fruits=[“Apple”,”Papaya”,”Mango”,”Orange”]
Animals=[“Tiger”,”Lion”,”Deer”,”Zebra”]
i. Write a program that asks user to enter a Color/Fruit/Animal name and it should tell which category belongs to , like its is a fruit or color or Animal
ii. Write a program that asks user to enter two items and it tells you if they both are in same category or not. For example if I enter yellow and Black, it will print "Both are colors" but if I enter yellow and Tiger it should print "They don't belong to same category"
2. Write a python program that can tell you if your grade score good or not . Normal Score range is 40 to 60.
i. Ask user to enter his score.
ii. If it is below 40 to 60 range then print that score is low
iii. If it is above 60 then print that it is good otherwise print that it is normal
Hint: Loop Questions
3. After appearing in exam 10 times you got this result,
result = ["Pass","Fail","Fail","Pass","Fail","Pass","Pass","Fail","Fail","Fail"]
Using for loop figure out how many times you got Pass
4. Write a program that prints following shape
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
5. Lets say you are running a 50 km race. Write a program that,
- Upon completing each 10 km asks you "are you tired?"
- If you reply "yes" then it should break and print "you didn't finish the race"
- If you reply "no" then it should continue and ask "are you tired" on every km
- If you finish all 50 km then it should print congratulations message
6. Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700 (both included).
7. Print square of all numbers between 10 to 20 except even numbers
8. Your Marks for five Test(test1 to test5) looks like this,
marks_list = [65, 75, 2100, 95, 83]
Write a program that asks you to enter marks and program should tell you in which test that marks occurred. If marks is not found then it should print that as well.