Python Evaluation

1. What is the Output of the following code?
for x in range(0.5, 5.5, 0.5):
   print(x)
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5]
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]
The Program executed with errors
2. What is the output of the following code?
listOne = [20, 40, 60, 80]
listTwo = [20, 40, 60, 80]

print(listOne == listTwo)
True
False
Error: invalid syntax
3. What is the output of the following code?
p, q, r = 10, 20 ,30
print(p, q, r)
10 20
10 20 30
Error: invalid syntax
4. What is the output of the following code?
valueOne = 5 ** 2
valueTwo = 5 ** 3

print(valueOne)
print(valueTwo)
10 15
25 125
Error: invalid syntax
5.
str = "pynative" print (str[1:3])
Py
Yn
Pyn
Yna
6.
var = "James" * 2 print(var)
JamesJames
JamesJamesJamesJamesJamesJames
Error: invalid syntax
7.

sampleList = ["Jon", "Kelly", "Jessa"] sampleList.append(2, "Scott") print(sampleList)
The program executed with errors
[‘Jon’, ‘Kelly’, ‘Jessa’, ‘Scott’]
[‘Jon’, ‘Kelly’, ‘Scott’, ‘Jessa’]
8.
var1 = 1
var2 = 2
var3 = "3"

print(var + var2 + var3)
6
123
Error. Mixing operators between numbers and strings are not supported
9.

salary = 8000 def printSalary(): salary = 12000 print("Salary:", salary) printSalary() print("Salary:", salary)
Salary: 12000 Salary: 8000
Salary: 8000 Salary: 12000
The program failed with errors
10. In Python3, which functions are used to accept input from the user
input()
Raw_input()
Int()
11. 
def add(a, b): return a+5, b+5 result = add(3, 2) print(result)
15
8
(8, 7)
12. Python function always returns a value
True
False
{"name":"Python Evaluation", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"1. What is the Output of the following code? for x in range(0.5, 5.5, 0.5):    print(x), 2. What is the output of the following code? listOne = [20, 40, 60, 80] listTwo = [20, 40, 60, 80] print(listOne == listTwo), 3. What is the output of the following code? p, q, r = 10, 20 ,30 print(p, q, r)","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker