PYTHON APTITUDE

PYTHON APTITUDE

University

12 Qs

quiz-placeholder

Similar activities

Diploma in IT - Computer Savvy Quiz

Diploma in IT - Computer Savvy Quiz

University

15 Qs

Marco de Referencia de la Competencia Digital Docente

Marco de Referencia de la Competencia Digital Docente

University

10 Qs

PDM - LS01 - Quiz 3 - Repetition

PDM - LS01 - Quiz 3 - Repetition

University

15 Qs

01mcb

01mcb

12th Grade - University

15 Qs

Testează-ți cunoștințele despre numerație

Testează-ți cunoștințele despre numerație

11th Grade - University

15 Qs

Quiz về Kiểu Dữ Liệu List và Set (1)

Quiz về Kiểu Dữ Liệu List và Set (1)

7th Grade - University

15 Qs

KUIS BAB 3

KUIS BAB 3

7th Grade - University

10 Qs

Kuis - Refleksi Materi Microsoft Excel

Kuis - Refleksi Materi Microsoft Excel

9th Grade - University

10 Qs

PYTHON APTITUDE

PYTHON APTITUDE

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

vanitha lawrance

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

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

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Find the output of the following program:

a = {i: i * i for i in range(6)} print (a)

{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5}
{0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6}
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 24}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program : 

print 0.1 + 0.2 == 0.3

0.3

True

False

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of this program?

Runtime Error

16

4

Indentation Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the expression : 3*1**3

27
9
3

1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following program : 

0

1

2

3

0

0

1

2

0

0

1

2

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which line of code produces an error?

(a)  “one” + “2”

(b)  ‘5’ + 6

(c)   3 + 4

(d)  “7” + ‘eight’

(a)

(b)

(c)

(d)

Answer explanation

The correct answer is (b) '5' + 6.

In Python, you cannot concatenate (add) a string and an integer directly. '5' is a string and 6 is an integer, so attempting to add them together will result in a TypeError.

Here's a breakdown of the other options:

(a) "one" + "2" is a valid string concatenation.

(c) 3 + 4 is a valid integer addition.

(d) "7" + 'eight' is a valid string concatenation.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Identify the invalid variable name in python?

(a)  this_is_a_variable = 7

(b)  abc = 10.22

(c)  ThisBook = “python”

(d)  %name = “xyz”

(a)

(b)

(c)

(d)

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?