Hurry! Try our new Interactive Courses for FREE. 🥳   🚀

Python Online Practice Test - 4

This Test will cover complete Python with very important questions, starting off from basics to advanced level.
Q. What is the output of below code?

print(type([1,2]))

Q. What is the output of below code?

print(type(1/2))

Q. What is the output of below code?

d = lambda p: p * 2
t = lambda p: p * 3
x = 2
x = d(x)
x = t(x)
x = d(x)
print(x)

Q. If PYTHONPATH is set in the environment, which directories are searched for modules?
I) PYTHONPATH directory
II) Current directory
III) Home directory
IV) Installation dependent default path

Q. Which one of these is not a loop control statement?
Q. Which one of the following is a mathematical function?
Q. What is the output of below code?

True = False
while True:
	print(True)
	break

Q. What is the output of below code?

x = "studytonight"
while i in x:
	print(i, end=" ")

Q. What is the output of below code?

x = 123
for i in x:
    print(i)

Q. What is the output of below code?

for i in '':
    print (i)

Q. What is the output of below code?

a = [0, 1, 2, 3]
for a[-1] in a:
    print(a[-1])

Q. What is the output of below code?

string = "study tonight"
for i in string.split():
    print (i, end=", ")

Q. What is the output of below code?

for i in range(2.0):
    print(i)

Q. What is the output of below code?

for i in range(0):
    print(i)

Q. What is the output of below code?

print(r"\nstudytonight")


Related Tests:


Explore more Subjects:

Tests for various other programming languages and subjects: