Programming and Problem Solving Through Python Language Theory Question
Introduction to Python - Set 3
Python is a case sensitive language when dealing with identifiers.
True
False
Sometimes
Never
Answer : A
Explain : Yes, Python is a case-sensitive language, so identifiers are case-sensitive.
Which of the following is not a keyword in python ?
return
in
False
false
Answer : D
Explain : In python, False is keyword, first letter is in Upper case.
Which of the following is true for variable names ?
unlimited length
limited length
ampersand can be used in its name
None of above
Answer : A
Explain : Variable can declare of any lenght.
Which of the following are valid escape sequences in Python ?
\n
\t
\\
All of the above
Answer : D
Explain : \n- End of line, \t- horizontal tab, \\- Blackslash.
In which language is Python written ?
C
C++
Java
None of above
Answer : A
Explain : Python written in the C programming language. It means that the Python interpreter is written in C.
Which keyword is used for function ?
fun
def
define
function
Answer : B
Explain : Here def is only keyword given and we also use def to define a function.
What keyword is used in Python to raise exceptions?
Raise
goto
try
except
Answer : A
Explain : The raise keyword raises an error and stops the control flow of the program.
Which one of the following is the correct extension of the Python file?
.python
.py
.p
None of above
Answer : B
Explain : Extension of python - .py.
How many keywords present in the python programming language?
32
29
33
64
Answer : C
Explain : But presently python have 35 keywords in Python 3.
Which of the following concepts is not a part of Python?
Pointers
Loops
Dynamic typing
All of the Above
Answer : A
Explain : Python use both loops and dynamic typing (which means that variable types are determined and checked at runtime rather than during compilation.)
To start Python from the command prompt, use the command ______
execute python
go python
python
run python
Answer :
Explain : Just open a command-line or terminal and then type in python, your python start.
Which of the following is not a data type in python?
String
numbers
Slice
List
Answer : C
Explain : Slice is not a data type.
PVM is often called _________.
Python Interpreter.
Python compiler
Python Volatile machine
Portable virtual machine
Answer : A
Explain : PVM is a software that converts bytecode to machine code for a given OS. PVM is also known as Python Interpreter.
Which is the special symbol used in python to add comments?
$
/
/*………..*/
#
Answer : D
Explain : For single line comment use # and for multi line use - ''.