Assignment 2(CIVIL)

Quiz
•
Computers
•
University
•
Hard
D. CSE2481
Used 2+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1. What is the output of the following for loop and range() function
for num in range(-2,-5,-1):
print(num, end=", ")
-2, -1, -3, -4
-2, -1, 0, 1, 2, 3,
-2, -1, 0
-2, -3, -4,
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the nested if-else structure below, what will be the value of x after code execution completes
x = 0
a = 0
b = -5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
2
0
3
4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following range() function
for num in range(2,-5,-1):
print(num, end=", ")
2, 1, 0
2, 1, 0, -1, -2, -3, -4, -5
2, 1, 0, -1, -2, -3, -4
2, 1, 0, -1, -2
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following if statement
a, b = 12, 5
if a + b:
print('True')
else:
print('False')
False
True
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid conditional statement in Python?
if a = 5:
if a == 5:
if a <> 5:
if (a = 5):
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the outcome if the elif and else blocks are missing in an if statement?
Syntax error
he program will stop
Nothing, it's optional
Runtime error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
x = 10;
if x > 5:
print("Greater")
Error
Greater
Nothing
Less
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
ROUND 1 QUIZ FOR 1ST YEAR

Quiz
•
University
20 questions
Day 7 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Quiz
•
University
20 questions
PYTHON PROGRAMMING Q5 ITERATIONS

Quiz
•
University
25 questions
Data Strucuture & Python

Quiz
•
University
20 questions
UNIT 1 PYTHON

Quiz
•
University
25 questions
Iedc Coders Club Programming Quiz

Quiz
•
University
20 questions
C Programming Upto Loops

Quiz
•
University
25 questions
C/C++ Programming Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University