Python Basics

Quiz
•
Computers
•
University
•
Hard
Cheshtaa Bhardwaj
Used 229+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the output of the following code snippet?
my_list = [1, 2, 3, 4, 5]
my_list.append(6)
print(my_list)
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5, 6]
[1, 2, 3, 4, 5, [6]]
[1, 2, 3, 4, 5, (6)]
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following statements is true about tuples in Python?
Tuples are mutable.
Tuples are ordered.
Tuples can have duplicate elements.
Tuples use curly braces {} for initialization.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the purpose of a Python dictionary?
To store data in an ordered sequence.
To store data as key-value pairs.
To store data in a sorted manner.
To store data in a linear structure.
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which of the following methods in Python is used to find the length of a string?
length()
count()
size()
len()
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What will be the output of the following code snippet?
x = 10
if x > 5:
print("Greater than 5")
else:
print("Less than or equal to 5")
"Greater than 5"
"Less than or equal to 5"
"x is equal to 5"
"x is greater than 10"
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
data = "No Way!" The expression len(data) evaluates to:
6
7
8
9
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Which operator returns True if target string is somewhere in the search string; otherwise it returns False.
==
!=
is
in
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
UNIT IV Normalization

Quiz
•
University
15 questions
Python Quiz (Basics,List,Tuple)

Quiz
•
University
15 questions
Python Programming 1: print, strings, variables, casting

Quiz
•
9th Grade - University
10 questions
Workshop 2 Review

Quiz
•
University
20 questions
PY-BUILD

Quiz
•
University
20 questions
Python Programming II CSE A

Quiz
•
12th Grade - University
10 questions
Python Basics

Quiz
•
University
20 questions
Beginner Quiz on ML and Python Basics

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University