Programming and Problem Solving Through Python Language Theory Question

Introduction to Python

  1. Python is a
    1. Low Level Language
    2. High Level Language
    3. Machine Lanuage
    4. 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.
  2. Which type of Programming does Python support?
    1. object-oriented programming
    2. structured programming
    3. functional programming
    4. All
    Answer : D
    Explain : Python support OOP , structure and functional programming.
  3. Is Python code compiled or interpreted?
    1. Python code is both compiled and interpreted
    2. Python code is neither compiled nor interpreted
    3. Python code is only compiled
    4. 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.
  4. Is python is case senstive while dealing with identifiers ?
    1. Yes
    2. No
    3. some times
    4. Never
    Answer : A
    Explain : Pythons is a case-senstive language which means when deal with identifiers it is also case senstive.
  5. All keywords in Python are in
    1. Capitalized
    2. lower case
    3. UPPER CASE
    4. None of the mentioned
    Answer : D
    Explain : Some python keyword uppercase, lower case. Total strength of keywords in python are 35.
  6. Which of following is not a keyword ?
    1. eval
    2. nonlocal
    3. assert
    4. finally
    Answer : A
    Explain : Eval is function in python not a keyword.
  7. Which keyword is used for function in Python language?
    1. fun
    2. Function
    3. def
    4. define
    Answer : C
    Explain : To define a function we used def keyword.
  8. What is the maximum length of indetifier ?
    1. 34
    2. 50
    3. 79
    4. Unlimited length
    Answer : D
    Explain : Length of identifier is unlimited.
  9. Which of the following is not a valid variable ?
    1. my
    2. my_1
    3. hi
    4. 1_my
    Answer : D
    Explain : Variable name should not start with number.
  10. The smallest individual unit in a program is known as in python
    1. Token
    2. Identifier
    3. Data type
    4. Keyword
    Answer : A
    Explain : Smallest individuals unit in a program is token.
  11. Which of following is true for variable names ?
    1. unlimited length
    2. limited length
    3. ampersand can be used in its name
    4. None of above
    Answer : A
    Explain : Variable in python can be declare of any length.
  12. Which of the following cannot be variable ?
    1. pr_1
    2. cdo
    3. in
    4. ooo
    Answer : C
    Explain : In is a keyword in python, so this cannot be declare as variable name.
  13. Which of the following is used to determine type of data types ?
    1. eval ()
    2. Type()
    3. type()
    4. data()
    Answer : C
    Explain : type() function is used to check data types.
  14. What is output of following code ?
    a= 50
    b=a=a*5
    print(b)
    
    
    1. 250
    2. 10
    3. 50
    4. Sytnax Error
    Answer : A
    Explain : b= 50=50*5 which becomes 250.
  15. What will be the Output of print(int()) ?
    1. 0
    2. 1
    3. 0.0
    4. None
    Answer : A
    Explain : We get integer value 0.

Next Set

2 3 4