WorksheetsPCEP Evaluation
Total questions: 25
Worksheet time: 13mins
Which of the following is incorrect for a dictionary in Python?
each key must be unique
the key should be an immutable object
the len() function returns the sum of key-value elements in the dictionary
the len() function returns the numbers of key-value elements in the dictionary
A complete set of commands is known as:
Instruction list
Code laws
Command-line
Command list
Which of the following are correct statements?
True + 1 evaluates to 1
True and False evaluates to False
True or False evaluates to False
7+ False evaluates to False
Octal has the following base:
2
8
10
16
If a list passed into function’s argument and modified inside the function:
Will affect the argument
Will not affect the argument
Will give an error
Will become global by default
An integer number preceded by an 0x (Zero-x) will be treated as:
Octal
Binary
Hexadecimal
Decimal
09. Who created Python?
Guido ban Rossum
Guido van Rossum
Guido the Russian
Guodo van Rossum
The meaning of positional parameter is determined by:
Position
Name
Style
None
The following expression : 2 ** 3 ** 2 ** 1
invalid
equal to 16
equal to 16.0
equal to 512
What would you insert instead of ??? so that the program prints 1024 to the monitor?
[0]
[1]
[-1]
[1024]
What is the expected output of the following snippet?
0
3
7
11
The program will cause a runtime exception
What is the expected output of the following snippet?
[2,4]
['C',2,4]
['B','C',2,4]
['A','B']
If the following snippet is executed and the exception is raised
two identical non-empty lines
two different non-empty lines
two empty lines
one non-empty line and one empty line
What is the expected behavior of the following snippet?
print hello
print h
print ello
cause a runtime exception on line 5
What is the expected output of the following snippet?
True
False
None
The program will cause a runtime exception/error
How many lines does each of the following code examples output when run separately?
Example 1: two, Example 2: one, Example 3: one, Example 4: one
Example 1: two, Example 2: one, Example 3: one, Example 4: two
Example 1: two, Example 2: one, Example 3: two, Example 4: three
Example 1: one, Example 2: one, Example 3: one, Example 4: two
What is the expected behavior of the following snippet?
print 5
print 8
print 3
code will run into an error
A process in which the source code is immediately executed without translating in into a machine code is called:
complilation
linking
interpretation
debugging
A code written in a high-level programming language is called:
a binary code
the ASCII code
a source code
machine code
Which of these would assist in making a string an integer?
int()
number()
stringint()
print()
What is IDLE?
An acronym that stands for Integrated Development and Learning Environment for python
A version of Python
An acronym that stands for Interactive Development and Learning Extension
An acronym that stands for Individual Development Language Exclusive
What do you call a tool that lets you launch your code step-by-step and inspect it at each moment of execution?
A console
A debugger
An editor
A notepad
What is the grammar of a programming language?
syntax
indentation
punctuation
program
Kind of loop used when you know the number of times you want it to repeat
list
for
while
if
A named, reusable set of programming statements to perform a specific task defines
applications
algorithms
modules
functions
