0% found this document useful (0 votes)
5 views1 page

Python Practice

The document outlines a series of tasks related to Python programming, including defining variables, explaining data types, and performing arithmetic operations. It also covers control flow statements, functions, and data structures like lists, tuples, and dictionaries. Additionally, it includes examples of using modules and demonstrates various programming concepts through practical exercises.

Uploaded by

jigishapatel580
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python Practice

The document outlines a series of tasks related to Python programming, including defining variables, explaining data types, and performing arithmetic operations. It also covers control flow statements, functions, and data structures like lists, tuples, and dictionaries. Additionally, it includes examples of using modules and demonstrates various programming concepts through practical exercises.

Uploaded by

jigishapatel580
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. Define variables in Python.

Write a program to assign values to variables and display


them.
2. Explain different data types in Python with examples.
3. Write a Python program to perform arithmetic operations (addition, subtraction,
multiplication, division) on two numbers.
4. Explain comparison operators in Python with suitable examples.
5. Write a Python program to demonstrate logical operators (and, or, not).
6. Explain the difference between Identity operators and Membership operators with
examples.
7. Write a Python program to perform basic list operations (add, remove, access elements).
8. Explain tuple characteristics and write a Python program to create and access a tuple.
9. Explain the syntax of the if statement with an example program.
10. Write a Python program using if–else statement to check whether a number is even or
odd.
11. Explain the elif ladder with a suitable example.
12. Write a Python program using nested if statements to find the largest of three numbers.
13. Write a Python program to print numbers from 1 to 10 using a for loop.
14. Write a Python program to print the multiplication table of a number using loops.
15. Write a Python program that iterates through a list and prints all elements using a loop.
16. Explain function arguments and return values with an example.
17. Write a Python function to calculate the factorial of a number.
18. Explain variable scope in Python (local and global variables) with examples.
19. Write a Python program to create and access a dictionary.
20. Write a Python function to find the sum of elements in a list.
21. Explain Python modules and write steps to import a module.
22. Write a Python program using the math module to calculate square root and power.
23. Explain how to create a user-defined module in Python with example.
24. Write a Python program to display the current date and time using the datetime module.
25. Write a Python program to swap two numbers without using a third variable.
26. Write a Python program to check whether a number is positive, negative, or zero.
27. Write a Python program to find the largest of three numbers using comparison
operators.
28. Write a Python program to check whether a number is even or odd using if–else
statement.
29. Write a Python function to find the square of a number and display the result.
30. Write a Python program using the math module to calculate square root, power, and
factorial of a number.
31. Write a Python function to calculate the factorial of a number.

You might also like