0% found this document useful (0 votes)
89 views

Python important questions Unit 1&2

The document contains a list of important short and long questions related to Python programming, covering topics such as data types, control statements, functions, and file handling. It includes questions that require explanations, examples, and programming tasks. The questions are designed to assess understanding of fundamental Python concepts and practical coding skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

Python important questions Unit 1&2

The document contains a list of important short and long questions related to Python programming, covering topics such as data types, control statements, functions, and file handling. It includes questions that require explanations, examples, and programming tasks. The questions are designed to assess understanding of fundamental Python concepts and practical coding skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Python important questions Unit 1 & 2.

Short Questions:

1. Explain how Python works?


2. Explain about the program development cycle?
3. How print function is used in Python?
4. Why are comments used in Python programming?
5. Explain about module in python?
6. What are logical operators?
7. What is a dictionary? Give an example?
8. What is a list? Illustrate with an example?
9. What is tuple? Illustrate with an example?
10. How to use math module in Python?
11. What is definite iteration? Give an example?
12. What is indefinite iteration? Give an example?
13. What are data types? Why they are used?
14. Explain about numeric data types?
15. Explain about random numbers?
16. What is an indentation in python?
17. Explain about Bit-wise operators with suitable example?
18. Write a python program using while loop to print the factorial of a given number?
19. Describe exception handling in python with example?
20. Explain about built-in functions?
21. Explain open() in python?
22. When is continue is used in a program?
23. Explain about the Pass in python programming?
24. What is a range function, why it is used?
25.

Long Questions:

1. What are the data types available in Python? Explain each one with example?
2. What is control statement. Explain with syntax and one example of each.
3. How can you format the output to display strings, integer values and float values. Explain each
with an example?
4. Explain break and continue with suitable example?
5. Write a program that accepts the length of three sides of a triangle as inputs. The program out
should indicate whether or not the triangle is an equilateral triangle.
6. What is recursive function? Write a recursive function to print the Fibonacci series.
7. Write any five differences between list and tuples. Write two examples of list and tuple.
8. Explain about functions? Types of arguments and illustrate with examples?
9. Write a program which reads a sentence and print each word of string in capital letter(Upper
Case)
10. What are control statements. Explain the syntax and one example for each.
11. Explain about list. Write a program to add, remove elements into list and finally delete the list.
12. Explain about if, if-else and nested if statements with proper syntax and example?
13. Define function? What are built-in functions and user defined functions with examples?
14. Write a program to test whether a number is divided by “5 and 10” or by “5 or 10”?
15. Write a program that prompts a user to enter two different numbers. Perform arithmetic
operations based on choices.
16. Explain about for loop with syntax and the use of range function in detail with example?
17. Write a program to calculate the sum of numbers from 1 to 30 which are not divisible by 2, 3 or
5.
18. What are files in python and explain the functions for opening, reading, writing and appending
the files.
19. Define a string in python and explain how to access characters and substrings from a given string
with an example program.
20. Write a program to print the following format
* * * *

* *

* *
* * * *

21. Write a program to print the following format

*****

****

***

**

22. Write a program to print the following format.


*
* *
* * *

* * * *

* * * * *
23. Explain about string and its built in function each with an example?

You might also like