Python U2M3 Test

Python U2M3 Test

9th - 12th Grade

16 Qs

quiz-placeholder

Similar activities

Quiz Informatika Kelas X

Quiz Informatika Kelas X

10th Grade

20 Qs

CMU quiz

CMU quiz

7th - 9th Grade

20 Qs

Arduino Loop

Arduino Loop

2nd Grade - University

20 Qs

2324tx6

2324tx6

9th - 12th Grade

20 Qs

Python List

Python List

4th Grade - University

15 Qs

Python

Python

8th - 9th Grade

15 Qs

# REVIEW 1 DATA TYPES

# REVIEW 1 DATA TYPES

10th Grade

15 Qs

BAI 26 + 27 TIN 10c1

BAI 26 + 27 TIN 10c1

10th Grade

20 Qs

Python U2M3 Test

Python U2M3 Test

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Jennifer OKeefe

Used 20+ times

FREE Resource

AI

Enhance your content in a minute

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

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following for loop code, the variable name is "student" because it can only be called "student" and cannot be replaced with another valid variable name such as "pupil".

students=["Alton", "Hiroto", "Skye", "Tobias"]

for student in students"

print("Hello", student)

True

False

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code is the best use of Python to iterate through the list "numbers"?


numbers=[7, 1, 5, 8, 0]

for range[5] in numbers:

for int in list:

for number in numbers:

all of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the best representation of the output expected for the following code.


cities=["New York", "Shanghai", "Munich", "Tokyo", "Dubai", "Mexico City", Sao Paulo", Hyderabad"]

for city in cities:

if city.startswith("P"):

print(city)

elif city.startswith("D"):

print(city)

Sao Paolo Dubai

Dubai

Sao Paulo

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code will result in the ltr_cnt=2 for counting the letter "c" found in the following test_string?


test_string='Mexico City'

-

ltr_cnt=test_string.count('c')

ltr_cnt=test_string.count('C')

none of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, range (0,5) is equivalent to the list[0, 1, 2, 3, 4]

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the best representation of the output expected for the following code.


numbers=" "

for x in range (7)

numbers +=str(x)

print(numbers)

0

7

1234567

0123456

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the best representation of the output expected for the following code.

number=" "

for x in range(2, 8, 2):

numbers+=str(x)

print(numbers)

2

8

2468

246

Create a free account and access millions of resources

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?