PythonQues&Ans Set1
PythonQues&Ans Set1
a.16
b.32
c.64
d.None of these above
Ans: d.None of these above
5) Which one of the following is the correct extension of the Python file?
a..py
b..python
c..p
d.None of these
Ans:a..py
10) Why does the name of local variables start with an underscore discouraged?
a.To identify the variable
b.It confuses the interpreter
c.It indicates a private variable of a class
d.None of these
Ans:c.It indicates a private variable of a class
12) Which of the following statements is correct for variable names in Python
language?
a.All variable names must begin with an underscore.
b.Unlimited length
c.The variable name length is a maximum of 2.
d.All of the above
Ans:b.Unlimited length
15) Which of the following operators is the correct option for power(ab)?
a.a ^ b
b.a**b
c.a ^ ^ b
d.a ^ * b
Ans:b.a**b
all([2,4,0,6])
What will be the output of this function?
a.False
b.True
c.0
d.Invalid code
Ans:a.False
18) Which one of the following has the highest precedence in the expression?
a.Division
b.Subtraction
c.Power
d.Parentheses
Ans:a.Division