0% found this document useful (0 votes)
3 views1 page

Quiz 01

The document is a Python Basics Quiz consisting of five questions related to Python programming concepts. It covers topics such as output of code snippets, list manipulation, if-else syntax, list methods, and loop iterations. Each question provides multiple-choice answers for the quiz taker to select from.

Uploaded by

muhammadishaq127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Quiz 01

The document is a Python Basics Quiz consisting of five questions related to Python programming concepts. It covers topics such as output of code snippets, list manipulation, if-else syntax, list methods, and loop iterations. Each question provides multiple-choice answers for the quiz taker to select from.

Uploaded by

muhammadishaq127
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Basics Quiz

1. What will be the output of the following code?


x = 5
y = ”5”
print ( x + int ( y ) )

A) 55 B) 10
C) Error D) ”55”
2. How do you append an element to a list in Python?
A) list.add(item) B) list.append(item)
C) list.insert(item) D) list.push(item)
3. What is the correct syntax for an if-else statement in Python?
A) if x == 5 then: print("Yes") else: print("No") B) if (x == 5) { print("Yes");
C) if x == 5: print("Yes") else: print("No") D) if x == 5: print("Yes") \\
4. What will the following code output?

numbers = [ 1 , 2 , 3 , 4 ]
numbers . pop ( )
print ( numbers )

A) [1, 2, 3] B) [1, 2, 3, 4]
C) [1, 2, 4] D) Error
5. How many times will the following loop run?
f o r i in range ( 2 , 1 0 , 2 ) :
print ( i )

A) 3 B) 4
C) 5 D) 8

You might also like