Search Header Logo

Module 3 Worksheet 1 & 2

Authored by Murugeswari.k Murugeswari.k

Computers

University

Used 2+ times

Module 3 Worksheet 1 & 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

choose the correct output for the following python code

 

for i in range(0,3,-1):
    print("Welcome")

Welcome Welcome Welcome

WelcomeWelcomeWelcome

Welcome

No output

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Identify the correct python code

if x>=45 :

if (x >= 45)

if (x => 45)

if x >= 45

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following Python code snippets correctly swaps the values of two variables, a and b without temporary variable?

a = b b = a

temp = a a = b b = temp

a, b = b, a

swap(a, b)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the range() function in Python when used for counting?

To generate a list of numbers in a specified range

To calculate the length of a list

To iterate over a sequence of numbers

To count the occurrences of a specific element in a list

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you attempt to calculate the factorial of a negative number in Python?

It calculates the factorial without any issues.

Python raises a ValueError

It returns 0

It returns 1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function can be used to convert a character to its corresponding integer value without using ASCII codes?

char_to_int(char)

int(char)

convert(char)

num(char)

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

________________keyword can be used instead of if in else part of the conditional statement?

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?