Python programming syntax

def add(a, b):
    "this function adds two numbers"
    return a+b

Objective Questions

1. Who is the inventor of python language?

A. Monte Python
B. Guido Van Rossum
C. Larry Wall
D. David H. Hansson

2. Which is not a features of python programming?

A. Object-oriented
B. Interactive
C. Interpreted
D. Statically typed

3. Which function is used to retrieve the data type of a variable or object?

A. type()
B. dtype()
C. dir()
D. help()

4. Which function is used to list attributes of a given object?

A. type()
B. dtype()
C. dir()
D. help()

5. Which is not a keyword in python3?

A. def
B. True
C. print
D. elif

6. Which keyword in used get other modules in python code?

A. import
B. include
C. inherit
D. install

7. Which of the following will be invalid python variable name?

A. abc123
B. _abc123
C. abc_123
D. 123_abc

8. Which is not correct data declaration in python?

A. x = -19.8
B. x = 1+2j
C. x, y = 1, 2
D. x, y, z = 1

9. Which of them will be False?

A. "hello" == 'hello'
B. 'a' == 'A'
C. 5 in [3, 4, 5]
D. 'a' not in "AEIOU"

10. Which of the following statement is incorrect?

A. var = "hello";
B. var = "hello " + "world"
C. var = 'I can't learn python'
D. a = 1; b = 2