Search Header Logo

Python challange

Authored by Sakthi Sakthi

Computers

University

Used 4+ times

Python challange
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 20 pts

What will be the output of the following program?

my_list=['two',5,['one',2]]

print(len(my_list))

3

6

4

2

Answer explanation

['one',2] is one element so the overall length is 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 20 pts

What will be the output of the following program?

x=10

def f():

x=x+10

print(x)

f()

20

10

Error

None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output following program?

str1="Python programming"

str1[0]="J"

print(str1)

Does not support

assignment operation

Jython programming

Jython

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

s1="Welcome to java programming"

s2=s1.replace("java","python")

print(s2)

welcome to java program

welcome to python program

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

List=[10,20,30,40,50,60,70]

del List[2:5]

print(List)

[10,20,70]

[10,20,60,70]

[30,40,50,60,70]

[30,40,50,60,70]

6.

MULTIPLE CHOICE QUESTION

30 sec • 20 pts

What will be the output of the following program?

def f():

x=10

x=x+10

print(x)

f()

20

Error

10

Function is not called

7.

MULTIPLE CHOICE QUESTION

30 sec • 19 pts

What will be the output of following code?

def fun_name(x):

x=200

x=100

text(x)

print(x)

100

200

Error

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