Python_Programming_All_Questions
Python_Programming_All_Questions
1. Distinguish between if-else, if-elif-else, for, and while control statements with illustrative code
snippets.
2. Write a Python program to convert temperature from Celsius to Fahrenheit. (Hint: C = (F - 32) * 5
/ 9)
4. Write a program to add n numbers accepted from the user and print the result.
5. Differentiate between different standard data types and Type conversion functions used in Python
6. Write a program to guess the number by taking input from keyboard and also to print the number
of guesses taken to guess the correct answer. Write the output of the program for sample inputs.
7. With definition of local and global variables, demonstrate the scope of local and global variables
8. Write a Magic 8 ball program using user-defined function, if statement, and randint function of
random module. Write the output of the program for sample input.
9. Define lists with illustrative examples and justify the following with examples over the list:
i) Indexing
ii) Slicing
v) sort()
10. a) Illustrate the usage of str(), int() and float() functions with suitable examples.
b) Write a program to read the name and age of a person. Display whether the person is a senior
OR
b) How the for loop along with range function works in Python? Illustrate with an example
program.
c) What is exception handling? Write a Python program to handle zero division error.