Assignment Python Programming
1. What is Python? Write any five features of Python.
2. Define a variable in Python. What are the rules for naming a variable? Give examples of
valid and invalid variable names.
3. Explain the different basic operators in Python with examples (arithmetic, relational,
logical, assignment, membership, identity).
4. What is a Python block? How is indentation used to define a block in Python? Give an
example.
5. What are Python data types? List and explain the built-in data types in Python with
examples.
6. Differentiate between int, float, and complex numeric types with examples.
7. Explain type conversion in Python with examples (implicit and explicit casting).
8. What is the difference between mutable and immutable data types? Give at least two
examples of each.
9. Write a Python program to declare and initialize variables of different types and print
their type using type() function.
10. Write a Python program to take two numbers from the user and perform the following
operations:
i. Addition
ii. Subtraction
iii. Multiplication
iv. Division (float and integer)
11. Write a Python program that checks whether a given number is positive, negative, or zero
using proper indentation (Python blocks).
12. Write a Python program to create variables of type: integer, float, string, boolean, list,
tuple, and dictionary. Print the value and type of each variable.
13. Write a Python program to take an integer and a float from the user, perform arithmetic
operations (addition, subtraction, multiplication, division), and display the result with its
type.
14. What is the difference between Python’s is operator and == operator? Explain with
examples
15. Write a Python program that takes the length and breadth of a rectangle from the user and
calculates:
i. Area
ii. Perimeter