Posts

Showing posts from September, 2023

Python Prerequisites for DL ( also Python Basics for Viva Voce)

 1. Define functions, invoke/call functions with arguments 2. Define Classes, Instantiate/create Objects call Object Methods 3. Variable types Int, Float, List , Tuple 4. Commenting Code 5. Manipulating Lists 6. Control Statements     WHile, Do.. While, For, If, else etc 7. Use of Indentation

MCQs on Python with answers

                              1. What is Python? a. A snake b. A programming language c. A type of database d. A web browser Answer: b. A programming language 2. Which symbol is used for comments in Python? a. // b. # c. /* */ d. %% Answer: b. # 3. Which data type is used for whole numbers in Python? a. float b. int c. str d. bool Answer: b. int 4. What does the print() function do in Python? a. Reads input from the user b. Displays output to the console c. Performs mathematical calculations d. Imports external libraries Answer: b. Displays output to the console 5. Which of the following is a valid variable name in Python? a. 123var b. my-variable c. _my_var d. break Answer: c. _my_var 6. How do you assign a value to a variable in Python? a. x = 5 b. value = x c. 5 = x d. x == 5 Answer: a. x = 5 7. What is the output of 5 + 3 ? a. 8 b. 53 c. 15 d. Error Answer: a. 8 8. Which of the following is used to...