1.What’s the value of this Python expression: “big” > “small” ?
Answer:False
2.What is the elif keyword used for?
Answer:To handle more than two comparison cases.
3.Students in a class receive their grades as Pass/Fail. Scores of 60 or more (out of 100) mean that the grade is “Pass”. For lower scores, the grade is “Fail”. In addition, scores above 95 (not included) are graded as “Top Score”. Fill in this function so that it returns the proper grade.
Answer:Pass
Fail
Pass
Pass
Top Score
Fail
4.What’s the value of this Python expression: 11 % 5?
Answer:1
5.The longest_word function is used to compare 3 words. It should return the word with the most number of characters (and the first in the list when they have the same length). Fill in the blank to make this happen.
Answer:chair
beyond
notebook
6.What’s the output of this code?
Answer:10
7.What’s the value of this Python expression?
((10 >= 5*2) and (10 <= 5*2))
Answer:True
8.The fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0 and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of attempting the division.
Answer: 0 , 0.25 , 0.66… , 0.5 , 0 , 0 and answer shown in comment also.
✓Intern in Bolt iot ✓frontend developer ✓java,Python,C✓IBM certified in Data Science and AI✓Google certified in Google Digital unlocked✓competative programmer✓web developer