SAFE - Python Workshop

SAFE - Python Workshop

University

10 Qs

quiz-placeholder

Similar activities

17 course French classical menu 01

17 course French classical menu 01

University

10 Qs

BSHM65

BSHM65

University

10 Qs

Iron Man

Iron Man

1st Grade - University

12 Qs

Lost and Found

Lost and Found

University

10 Qs

Games Summer Course Day 1

Games Summer Course Day 1

University

15 Qs

A4/B3 Maintenance Assessment Power transmission system

A4/B3 Maintenance Assessment Power transmission system

University

15 Qs

Alberta Natural Resources #2

Alberta Natural Resources #2

KG - University

12 Qs

Accounting 100

Accounting 100

University

13 Qs

SAFE - Python Workshop

SAFE - Python Workshop

Assessment

Quiz

Other

University

Practice Problem

Medium

Created by

bubu babu

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Which of the following is not non-primitive data type?

List

Tuple

Dictionary

String

2.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the output of the following code snippet?

x = 5

y = 10

if x < y:

print("x is less than y")

elif x == y:

print("x is equal to y")

else:

print("x is greater than y")

x is less than y

x is equal to y

x is greater than y

Error: Invalid syntax

3.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

How many times will the following for loop iterate?

for i in range(3, 6):

print(i)

2

5

4

3

4.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What does the "break" statement do in a loop?

Terminates the loop and transfers control to the next iteration

Continues to the next iteration of the loop

Exits the entire program

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Which of the following is the correct syntax to define a function in Python?

def my_function():

function my_function():

define my_function():

function def my_function():

6.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What will be the output of the following function call?

def square(x):

return x * x

result = square(3) + square(4)

print(result)

12

21

49

25

7.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What is the output of the following code snippet?


x = 10

while x > 0:

print(x)

x -= 2

10 8 6 4 2

10 9 8 7 6 5 4 3 2 1

10 7 4 1

Infinite loop

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?