No student devices needed. Know more
52 questions
What will be the output?
name = 'Dave'
print (name)
Dave
dave
name
(name)
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
Give Output
a = 4
b = 6
print(a*b)
24
12
6
a*b
What will be the output?
x = 5
print(x == 2)
True
0
2
False
Give output (assume indentation)?
a = 2
If a<3:
print(a+1) #indentation
else:
print(a-1) #indentation
3
2
1
0
Give Output (assume indentation)
b = 2
if b > 4:
b = b + 2 #indentation
print(b)
4
2
0
None
What will be the result?
a = 5
b = 10/2
print(a == b)
True
5
0
False
Give output (assume indentation)
a = 2
b = 5
if a > b:
c = a # indentation
else:
c = b # indentation
print(c)
2
5
None
0
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
What is the output?
more than 7
more than 23
spam
7
What is the output?
True
False
condition1
condition2
What is the output?
250.0
200.0
300.0
350.0
What is the output?
next
stop
next
stop
syntax error - program doesn't work
What is the output?
40
15.0
30
25.0
What is the output of Following code?
List = ['spam', 2.0, 5, [10, 20]]
print(List[2])
In Python, list is mutable
True
False
What is the output of the following code?
list = [1,2,3,4,5,6,7,8,9,10]
print(list[1:2])
What is the output of the following code?
list = [1,2,3,4,5,6,7,8,9,10]
print(list[2:1])
What is the output of the following code?
list = [1,2,3,4,5,6,7,8,9,10]
print(list[::-3])
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
Compilation error
[8,9,10]
[10, 7, 4, 1]
What is the output of the following code?
list = []
list.append(1)
list.append(2.0)
list.append("vk")
print(list)
[1, 2.0, 'vk']
Error
['vk', 1, 2.0]
No putput
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
When we create a program to extract each alphabet from a given string, what is it known as?
Transpose
Traverse
Translate
Terminate
Which of the operator can be used in Strings?
+
*
Both of the above
None of the above
word = "amazing"
For the given string if we run word[2:5] what does it mean?
It will extract alphabets from index 2 to index 4
It will extract alphabets from index 2 to index 5
It will extract alphabets from position 2 to position 4
It will extract alphabets from position 2 to position 5
s1="Hello"
n1=10
print(s1+n1)
What is the error in this code?
Print statement not written in quotes
Numeric value not written in quotes
colon not written after the print statement
string cannot be added to a number
[1, 2, 8, 9] < [1, 2, 8, 4]
What will be the result if we compare these two lists?
True
False
Explore all questions with a free account