Python Practice Test #3

Python Practice Test #3

Professional Development

30 Qs

quiz-placeholder

Similar activities

2018 IFGC CH 6B

2018 IFGC CH 6B

Professional Development

25 Qs

CINEASTE 2.0 ROUND 1

CINEASTE 2.0 ROUND 1

KG - Professional Development

25 Qs

2018 IPC CH 5 Quiz

2018 IPC CH 5 Quiz

Professional Development

25 Qs

2018 IPC CH 3A Quiz

2018 IPC CH 3A Quiz

Professional Development

25 Qs

SJIT ECE PLACEMENT PRACTICE TEST-3

SJIT ECE PLACEMENT PRACTICE TEST-3

Professional Development

30 Qs

Pre Test Pneumatic

Pre Test Pneumatic

KG - Professional Development

25 Qs

01102025

01102025

Professional Development

30 Qs

Post-Test Under Cyber Closet Project

Post-Test Under Cyber Closet Project

Professional Development

25 Qs

Python Practice Test #3

Python Practice Test #3

Assessment

Quiz

Other

Professional Development

Medium

Created by

Matt Little

Used 25+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What will be the output after running the following code?

func1

func3

func3

func3

func3

func1

func1

func2

func3

func3

func2

func1

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What will be the output after running the following code?

[7, 2]

[7, 6, 5, 4, 3, 2]

[7, 3]

SyntaxError

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What will be the output after running the following code?

Yes

True

error

No

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What will be the output when the following program is run?

5,4,'Earth'

[5,4]

[5, 4, 'Earth']

{5,4,'Earth'}

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What is the output of the following code:

<class 'tuple'>

<class 'list'><class 'int'>

<class 'list'>

error

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What will the output be after executing this code?

True True False

False False True

False True False

False False False

Answer explanation

When bool() is provided an empty list, an empty string or the value 0 as an argument, it returns False. The expression will evaluate to True when bool () is given any other value, including negative numbers.

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What is the output of the following print statement?

False

True

SyntaxError

10

Answer explanation

The is operator is an identity operator, it checks whether both the operands refer to the same object or not. The p and q have equal values, stored in the same memory location, hence p and q are same. You can use id() function to check if the variables are same: print(id(p)) print(id(q)) which will indicate the same ID for both variables.

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?