PYTHON PROGRAMMING

PYTHON PROGRAMMING

University

10 Qs

quiz-placeholder

Similar activities

1.1.1 The structure and function of the processor

1.1.1 The structure and function of the processor

11th Grade - University

15 Qs

Hyrje në SO

Hyrje në SO

University

10 Qs

basic computer design

basic computer design

University

10 Qs

SE Quiz 2 (JKL)

SE Quiz 2 (JKL)

University

10 Qs

SO-750

SO-750

University

10 Qs

Quiz Lec2

Quiz Lec2

KG - University

10 Qs

FGCT4023 Topic 6 - Interactivity

FGCT4023 Topic 6 - Interactivity

University

10 Qs

komponen-komponen komputer

komponen-komponen komputer

University

10 Qs

PYTHON PROGRAMMING

PYTHON PROGRAMMING

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Sumaiya Begum

Used 21+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following code:

x=3

If x>2 or x<5 and x==6:

Print(“ok”)

else:

print(“no output”)

ok

okok

no output

none of above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of the following if statements will not execute successfully?

1) if (1, 2);

print(‘foo’)

2) if (1, 2):

print(‘foo’)

3) if (1):

print( ‘foo’ )

4) if (1);

print( ‘foo’ )

1,4

2

2,4

4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Find the output of the following program segments:

for i in range(20,30,2):

print(i)

20 22 24 26 28

20

22

24

26

28

20 22 24 26 28 30

20

22

24

26

28

30

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of the following is incorrect?

The variables used inside function are called local variables.

The local variables of a particular function can be used inside other functions, but these cannot be used in global space.

The variables used outside function are called global variables

In order to change the value of global variable inside function, keyword global is used.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly show how to import and use the add() function? Select all that apply.

from adder import add

result = adder.add(2, 3)

from adder import add

result = add(2, 3)

import add from adder

result = add(2, 3)

import adder

result = adder.add(2, 3)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the given below program?

print("Know Program".split())

‘Know’, ‘Program’

(‘Know’, ‘Program’)

[‘Know’, ‘Program’]

{‘Know’, ‘Program’}

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Find the output of the given Python program?

print(list("abcd".split('')))

[‘a’, ‘’, ‘b’, ‘’, ‘c’, ‘*’, ‘d’]

[‘a’, ‘b’, ‘c’, ‘d’]

[‘abcd’]

[‘abc*d’]

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