Font size
WorksheetsBasic of Programming - Quiz 02
Total questions: 15
Worksheet time: 15mins
Which of the following is invalid?
_a = 1
__a = 1
__str__ = 1
none of the mentioned
Which of the following is an invalid variable?
my_string_1
1st_string
foo
_
Which of the following is an invalid statement?
abc = 1,000,000
a b c = 1000 2000 3000
a,b,c = 1000, 2000, 3000
a_b_c = 1,000,000
What is the answer to this expression, 22 % 3 is?
7
1
0
5
Mathematical operations can be performed on a string.
True
False
Which of these in not a core data type?
Lists
Dictionary
Tuples
Class
What will be the output of the following Python code?
he
lo
olleh
hello
What data type is the object below?
L = [1, 23, 'hello', 1]
list
dictionary
array
tuple
In order to store values in terms of key and value we use what core data type.
list
tuple
class
dictionary
What is the average value of the following Python code snippet?
85.0
85.1
95.0
95.1
Select all options that print.
hello-how-are-you
print(‘hello’, ‘how’, ‘are’, ‘you’)
print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
print(‘hello-‘ + ‘how-are-you’)
print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘you’)
What will be the output of the following Python code?
0 1 2 3 0
0 1 2 0
0 1 2
error
What will be the output of the following Python code?
0 1 2
{0, 1, 2} {0, 1, 2} {0, 1, 2}
error
none of the mentioned
What will be the output of the following Python code?
0
no output
error
none of the mentioned
What will be the output of the following Python statement?
a
bc
bca
abc
