Programming and Problem Solving Through Python Language Theory Question
Introduction to Python
Python is a
Low Level Language
High Level Language
Machine Lanuage
Assembly Language
Answer : B
Explain : Python is a high level language which is developed by Guido Van Rossum in 1989 and release in 1991. Python is understand by programmer and computer convert its source code into object code with the help of interprater to understand.
Which type of Programming does Python support?
object-oriented programming
structured programming
functional programming
All
Answer : D
Explain : Python support OOP , structure and functional programming.
Is Python code compiled or interpreted?
Python code is both compiled and interpreted
Python code is neither compiled nor interpreted
Python code is only compiled
Python code is only interpreted
Answer : A
Explain : Python code is both compilied and interpreted. There are a lot of languages which have been implemented using both compilers and interpreters, including C, Pascal, as well as python. When we talk about python language it is interprated language. But python code is both compilied and interpreted.
Is python is case senstive while dealing with identifiers ?
Yes
No
some times
Never
Answer : A
Explain : Pythons is a case-senstive language which means when deal with identifiers it is also case senstive.
All keywords in Python are in
Capitalized
lower case
UPPER CASE
None of the mentioned
Answer : D
Explain : Some python keyword uppercase, lower case. Total strength of keywords in python are 35.
Which of following is not a keyword ?
eval
nonlocal
assert
finally
Answer : A
Explain : Eval is function in python not a keyword.
Which keyword is used for function in Python language?
fun
Function
def
define
Answer : C
Explain : To define a function we used def keyword.
What is the maximum length of indetifier ?
34
50
79
Unlimited length
Answer : D
Explain : Length of identifier is unlimited.
Which of the following is not a valid variable ?
my
my_1
hi
1_my
Answer : D
Explain : Variable name should not start with number.
The smallest individual unit in a program is known as in python
Token
Identifier
Data type
Keyword
Answer : A
Explain : Smallest individuals unit in a program is token.
Which of following is true for variable names ?
unlimited length
limited length
ampersand can be used in its name
None of above
Answer : A
Explain : Variable in python can be declare of any length.
Which of the following cannot be variable ?
pr_1
cdo
in
ooo
Answer : C
Explain : In is a keyword in python, so this cannot be declare as variable name.
Which of the following is used to determine type of data types ?
eval ()
Type()
type()
data()
Answer : C
Explain : type() function is used to check data types.
What is output of following code ?
a= 50
b=a=a*5
print(b)
250
10
50
Sytnax Error
Answer : A
Explain : b= 50=50*5 which becomes 250.