python 2

python 2

12th Grade

20 Qs

quiz-placeholder

Similar activities

Variable Scope in Python

Variable Scope in Python

1st Grade - Professional Development

15 Qs

Basic Python Coding

Basic Python Coding

9th - 12th Grade

20 Qs

quiz_4

quiz_4

9th - 12th Grade

20 Qs

การเขียนโปรแกรมภาษา python ม.5 ภาคเรียนที่ 2 ปีการศึกษา 2561

การเขียนโปรแกรมภาษา python ม.5 ภาคเรียนที่ 2 ปีการศึกษา 2561

10th - 12th Grade

20 Qs

DA METER REVIEW #5

DA METER REVIEW #5

12th Grade

18 Qs

XII_CS_FUNCTIONS

XII_CS_FUNCTIONS

12th Grade

15 Qs

Introduction to Programming (Ch2)

Introduction to Programming (Ch2)

9th - 12th Grade

16 Qs

Ôn tập cuối kì Mùa Xuân Tin học 10.1

Ôn tập cuối kì Mùa Xuân Tin học 10.1

10th Grade - University

24 Qs

python 2

python 2

Assessment

Quiz

Computers

12th Grade

Hard

Created by

M. Kumar

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?