
Week 2
Authored by Zamart Ramazanova
Other
University
Used 17+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the result of the condition passed in the if block in Python?
“Boolean Output”
”Numeical Output”
”Both based on the scenaio”
”None of these”
Answer explanation
In Python, the condition in an if block evaluates to a Boolean output (True or False). Therefore, the correct answer is 'Boolean Output'.
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of following is not a decision-making statement?
if-elif statement
for statement
if -else statement
if statement
Answer explanation
This is a looping statement, not a decision-making statement. It is used to iterate over a sequence, such as a list, tuple, or range.
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What keyword would you use to add an altenative condition to an if statement?
else if
elseif
elif
None of the above
Answer explanation
The elif keyword stands for "else if" and allows you to check additional conditions after an initial if statement.
If the if condition evaluates to False, Python checks the condition provided in the elif statement.
This structure helps handle multiple conditions in a clean and efficient way.
The elif keyword stands for "else if" and allows you to check additional conditions after an initial if statement.
If the if condition evaluates to False, Python checks the condition provided in the elif statement.
This structure helps handle multiple conditions in a clean and efficient way.
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which statement will check if a is equal to b?
if a = b:
if a == b:
if a === c:
if a == b
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In python which of the following operator is used after condition of if statement?
Semicolon (;)
Comma (,)
Colon (:)
Dot (.)
Answer explanation
In Python, a colon (:) is used after the condition in an if statement to indicate the start of the code block that belongs to the if statement.
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which one of the following outputs will print on the console successfully? For the following code segment:
False True
True True
False
none of the above
Answer explanation
Condition: 4 + 5 == 10
This evaluates to False because 4 + 5 = 9, not 10.
Therefore, the else block is executed, which prints "False".
Outside the if-else block:
The statement print("True") is executed unconditionally, as it is not part of the if-else block.
Output:
Condition: 4 + 5 == 10
This evaluates to False because 4 + 5 = 9, not 10.
Therefore, the else block is executed, which prints "False".
Outside the if-else block:
The statement print("True") is executed unconditionally, as it is not part of the if-else block.
The output printed on the console will be:
False
True
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Predict the output of the following code:
ok
okok
no output
none of above
Answer explanation
This is because and has higher precedence than or.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
General Awareness
Quiz
•
University
20 questions
Quiz ODC-Jan 2021
Quiz
•
University
20 questions
Quiz No. 1_EA
Quiz
•
University
20 questions
NDT Webinar Quiz Bee
Quiz
•
University
15 questions
Hash Tables Quiz
Quiz
•
University
15 questions
Management Communication N4 - Module 5
Quiz
•
University
16 questions
Newspaper
Quiz
•
5th Grade - Professio...
20 questions
QUIZ WEEK 6
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Other
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University