python 2

python 2

12th Grade

20 Qs

quiz-placeholder

Similar activities

Lua Review Corona SDK with Notepad++

Lua Review Corona SDK with Notepad++

10th - 12th Grade

15 Qs

Ôn tập học kỳ I

Ôn tập học kỳ I

9th - 12th Grade

20 Qs

Asesmen Sumatif

Asesmen Sumatif

12th Grade

15 Qs

Cyber Security 12 IPA Zhuo

Cyber Security 12 IPA Zhuo

12th Grade

20 Qs

TIK VII YT, GC, VIDCOF

TIK VII YT, GC, VIDCOF

7th - 12th Grade

20 Qs

Quiz Inf X.B

Quiz Inf X.B

10th Grade - University

20 Qs

CSS - Computer Systems Services

CSS - Computer Systems Services

12th Grade

20 Qs

Python Recap

Python Recap

7th Grade - University

20 Qs

python 2

python 2

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

M. Kumar

FREE Resource

AI

Enhance your content in a minute

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

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

print(str(True),end = ” “)

int(“4.5”)

True SyntaxError

'True' ValueError

True 4

SyntaxError SyntaxError

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following coding blocks gives the output as “Python”?

a.

def fun1():

    name=”a”

    def fun2():

        nonlocal name

        name=”PythonGeeks”

    fun2()

    print(name)

fun1()

b.

def fun1():

    name=”a”

    def fun2():

        nonlocal name

        name=”PythonGeeks”

    print(name)

fun1()

c.

def fun1():

    name=”a”

    def fun2():

        name=”PythonGeeks”

    fun2()

    print(name)

fun1()

d.

def fun1():

    name=”a”

    def fun2():

        nonlocal name=”PythonGeeks”

    fun2()

    print(name)

fun1()

a

b

c

d

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following codes do not give any error and follow the good practices of naming?

a.

a=3

b=4

sum=a+b

print(sum)

b.

num1=3

num-2=4

sum=num1+num-2

print(sum)

c.

num1=3

num2=4

sum=a+b

print(Sum)

a

b

c

none

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What could be the output?

19

4

13

none

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code?

from decimal import Decimal as D

print(D(7.2)-D(4.1))

3.1

-3.1

3.100000000000000532907051820

Error

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

print(not(True and False or True),end=" ")

print(not True and False or True)

True False

False False

True True

False True

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following gives the output as 3 if

seq1=[1,3,5,3,5,7,3,0]

seq2=(1,3,5,3,5,7,3,0)

seq1[-5]

seq2.count(3)

len(seq2[2:5])

All the above

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?