PYTHON PROGRAMMING

Quiz
•
Computers
•
University
•
Hard
Sumaiya Begum
Used 18+ times
FREE Resource
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’]
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Que Tanto Sabes de Tecnologia

Quiz
•
KG - University
9 questions
C# - Ficheiros 1

Quiz
•
10th Grade - University
10 questions
Part 2 - Command Line

Quiz
•
University
9 questions
Command Line

Quiz
•
12th Grade - Professi...
10 questions
Exploring Python: Input and Output Essentials

Quiz
•
9th Grade - University
15 questions
Python introduction

Quiz
•
University
10 questions
QUIZ 2 NDJ10303 v1

Quiz
•
University
10 questions
Wrażenia globlne w Linxie

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University