Page 357 - Artificial Intellegence_v2.0_Class_9
P. 357
Viva Voce Questions
1. What type of language is Python?
Ans. Python is a scripting language.
2. How is Python an interpreted language?
Ans. An interpreted language is any programming language which is not in machine level code before runtime. Therefore,
Python is an interpreted language.
3. What are Python modules?
Ans. Python modules are files containing Python code. This code can either be functions classes or variables. A Python
module is a .py file containing executable code.
4. Name some commonly used built-in modules in Python?
Ans. Some of the commonly used built-in modules are:
a. os b. sys
c. math d. random
e. datetime f. JSON
5. Is Python case sensitive?
Ans. Yes, Python is a case sensitive language.
6. Is indentation required in Python?
Ans. Indentation is necessary for Python. It specifies a block of code. All codes within loops, classes, functions, etc. are
specified within an indented block. It is usually done using four space characters. If your code is not indented necessarily,
it will not execute accurately and will throw errors as well.
7. How do you write comments in Python?
Ans. Comments in Python start with a # character. However, alternatively at times, commenting is done using docstrings
(strings enclosed within triple quotes).
8. What is the purpose of is, not, and in operators?
Ans. Operators are special functions. They take one or more values and produce a corresponding result.
a. is: returns true when 2 operands are true (Example: "a" is 'a').
b. not: returns the inverse of the boolean value.
c. in: checks if some element is present in some sequence.
9. What does len() do?
Ans. It is used to determine the length of a string, a list, an array, etc.
10. Is Python interpreted language?
Ans. Yes, Python is an interpreted language.
11. Is Python Object-Oriented Language?
Ans. Yes, Python is an Object-Oriented Language.
12. How many modes are available in Python?
Viva Voce Questions 355

