Recent questions tagged goclasses-da-dpp-day-196

3 3 votes
3 3 answers
148
148 views
Consider the following Python code:values = [0, "", [], "0", [0], None] score = 0 for item in values: if item: score += 2 else: score -= 1 print(score)What is the output ...
2 2 votes
1 1 answer
106
106 views
Consider the following Python code:x = 0 y = 8 result = (x != 0 and y / x 2) or (y 5 and x == 0) print(result)What is the output of the code above?TrueFalseZeroDivision...
1 1 vote
2 2 answers
121
121 views
Consider the following Python code:a = 4 b = 6 c = 6 d = 9 result = a + 2 == b <= c < d print(result)What is the output of the code above?TrueFalse6Error
3 3 votes
3 3 answers
121
121 views
Consider the following Python code:marks = 68 bonus = 5 grade = "" if marks >= 60: if marks + bonus >= 75: grade = "A" elif marks % 2 == 0: grade = "B" else: grade = "C" ...
1 1 vote
2 2 answers
118
118 views
Consider the following Python code:x = 12 y = 5 ans = 0 if x % 3 == 0 and y 5: ans = x + y elif x // y == 2 or y % 2 == 0: ans = x - y elif x 10: ans = x * y else: ans ...
To see more, click for the full list of questions or popular tags.