Signup/Sign In

Python Online Practice Test - 3

This Test will cover complete Python with very important questions, starting off from basics to advanced level.
Q. What is the order of precedence in python?
Q. What is the value of following expression: 3*1**3
Q. Which one of the following have the same precedence?
Q. What will be the output of the below program?

>>>str="studytonight"
>>>str[:5]
>>>

Q. What is the datatype of below statement?

L = [1, 'hello', 'studytonight', 1]

Q. Which datatype is used to store values in terms of key and value?
Q. What does ~9 evaluate to?
Q. What is the value of following expression: 24//6%3
Q. What is the value of following expression: bin(0x8)

Q. What is the output of the code shown below?

bool('False')
bool()

Q. What is the output of the code shown below?

['study', 'tonight'][bool('')]

Q. What is pass statement in Python?
Q. What is the output of the code shown below?

if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("study")
else:
    print("tonight")
    
Q. What is the output of the code shown below?

X="studytonight"
print("05d"%X)

Q. What is the output of the code shown below?

s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')


Related Tests: