Python Basics

Python Basics

University

15 Qs

quiz-placeholder

Similar activities

Visual Basic 2010

Visual Basic 2010

8th Grade - University

10 Qs

CS100||MsWord

CS100||MsWord

University

10 Qs

DSA quiz 3 set 1

DSA quiz 3 set 1

University

10 Qs

CBA Excel 1

CBA Excel 1

University

10 Qs

2. Ayo Main Quiz Lagi

2. Ayo Main Quiz Lagi

University - Professional Development

20 Qs

SOFTWARE 7I

SOFTWARE 7I

7th Grade - University

20 Qs

Python Quiz

Python Quiz

University

15 Qs

System Analysis & Design

System Analysis & Design

University

10 Qs

Python Basics

Python Basics

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Cheshtaa Bhardwaj

Used 324+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers