Chapter 3 Introduction to Python objective questions (M3-R5)

Multiple Choice questions


1.   Feature of Python program is
a.    Easy to learn and read
b.    Interactive Mode
c.    Free and Open Source
d.    All of the above

2.   Which of the following is not true about an interpreter?
a.    Interpreter generates an object program from the source program
b.    Interpreter is a kind of translator. 
c.    Interpreter analyses each source statement every time it is to be executed.
d.    None of the above

3.   Comment in Python starts with___?
a.    
b.    #  
c.    &
d.    !

4. Python is being used in many diverse field as 
a.      Scripting
b.      Web Application
c.       GUI Programming
d.      All of the above

5. Limitation of Python language is____
a.       Not the fastest language
b.      Lesser libraries
c.       Both (a) and (b)
d.      None of the above

6.       What is the maximum possible length of an identifier?
a.      31 characters
b.      63 characters
c.      79 characters
d.      None of the above

7.       The plus (+) is called
a.      Concatenation Operator
b.      Repetition Operator
c.       Both (a) and (b)
d.      None of the above

8. An example of literal constant is__?
a.       5
b.      1.23
c.      'This is a string'
d.      All of the above

9. Examples of valid identifier name are__
a.       i
b.      _my_name
c.      Both (a) and (b)
d.      58Jazz

10. Strings are defined using__
a.       Single Quote (')
b.      Double Quote (")
c.      Triple Quote (""")
d.      All of the above

11. Which of the following is not a keyword in Python?
 a.     for
b.      if
c.      print
d.      All are the keyword
9
9*  State true or False for the following:

1.       Every value in python has a data typeTrue
2.       Strings can be displayed on screen using print function. True
3.       Int or integer, is a whole number, positive or negative, without decimals  of unlimited length. True
4.       Float can also be scientific numbers with an "e" to indicate the power of 10. True
5.       To indicate hexadecimal literals, you will use the prefix '0X' or "0x".  True
6.       Boolean can have three permissible values.  False
7.       Square brackets can be used to access elements of the strings. True
8.    Python has a special function called type that tells us the data type of any value. True
9.    Python does not need to be compiled before it is run. True
10.  Complex numbers are always represented as two floating point numbers, the real and the imaginary part. True


Match the following:




Fill in the blanks:

1.       Converting one data type to another data type is called Typecasting
2.    In Python, # symbol is used to add comment.
3.    Strings are defined using quotes ( " , ' , or """ ).
4.    In Python, Input  is used to request and get information from the users.
5.    Literals  can be defined as a data which is given in a variable or consonant.        .
6.    IDLE  is the basic editor and interpreter environment.
7.    >>> is the default Python prompt of the interactive shell.
8.    Object code is a program that the computer can directly execute.
9.    A program stored in a file (usually one that will be interested) is called  Script.
10.  Comment  are the entries in a computer program for the purpose of documentation or explanation.

Post a Comment

0 Comments