0% found this document useful (0 votes)
9 views5 pages

Python Assignments 1 To 4

Python assignment gtu

Uploaded by

yashbadgujar1533
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)
9 views5 pages

Python Assignments 1 To 4

Python assignment gtu

Uploaded by

yashbadgujar1533
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
You are on page 1/ 5

Assignment: 1

Chapter – 1 Fundamentals of Python

1. Define: - Python
2. Give the difference between Scripting Language and Programming Language.
3. List and explain features of Python. (Winter -22, Summer – 23).
4. Write Application of python.
5. Give the difference between intermediate mode and script mode?
6. What is a statement and multi-line statement?
7. What are strings, variable python numbers and standard data types in python?
8. Explain basic structure of Python Program.
9. Explain keyword, identifier and variable.
10. Explain data type with example.
11. Explain input and print method of python.
12. Explain Input and Output statements in Python by giving examples. (Summer – 23).
13. Explain type casting with example. (Winter -22)
14. List out operator and explain bitwise operator.
15. List out arithmetic operations. Build python code that performs three arithmetic operations.
(Summer – 23).
16. List out the rules for defining variables and explain the assignment operators of python in
details. (Summer – 23).

SMG
Assignment: 2

Chapter – 2 Control Flow Structures

1. Give the difference between Boolean value and Boolean expression.


2. List out different types of control statements in python and explain any one. (Winter -22).
3. Explain if, if-else, and if-elif-else control structure in Python. (Winter -22, Summer 23).
4. Explain python selection statements with flowchart, syntax and example. (Summer 23).
5. Explain while loop with flowchart, syntax and example.
6. Explain for loop and nested for loop with flowchart, syntax and example.
7. Explain switch case statement with flowchart, syntax and example.
8. Explain break, continue and pass statement with flowchart, syntax and example. (Summer 23).
9. Explain for loop with example. (Winter -22).

SMG
Assignment: 3

Chapter – 3 Lists, Tuples, Sets and Dictionaries

1. Explain collections in Python.


2. Define List. Write Characteristics of list.
3. How to create a list. Explain append(), extend(), insert() and delete operations on list.
4. Write Characteristics of Tuple. Explain indexing and slicing in tuple.
5. Give the difference between List and Tuple.
6. Explain how to create tuple in Python by giving example. (Summer -23).
7. What is Slicing?
8. Write Characteristics of Set.
9. How python set is modified? Or Explain add(), update(), remove() and discard() method of set.
10. Explain mathematical operations on Set (Union, Intersection, Difference and Symmetric
difference).
11. Explain how to create a Set in Python by giving example. (Summer -23).
12. Write Characteristics of Dictionary. Explain operations on dictionary (Accessing, changing,
updating and removing).
13. Explain below string functions: - max, isalpha, islower, isspace, count, rfind and swapcase.
14. Differentiate between append() and extend() methods of list.

SMG
Assignment: 4

Please write a program based on the following


instructions.

Winter 22

1. Write a program to calculate simple and compound interest.


(𝑃∗𝑅∗𝑇)
Simple Interest = 100

And
𝑅
Compound interest = [(1 + (100∗𝑁)
) 𝑁∗𝑇 − 1]

Where

P = Principal amount,
R = Rate of interest,
T = Total duration,
N = Number of times interest got compounded annually.
2. Write a program to find the sum of following series:
1 1 1
1 + 3 + 5 + 7 … . . 𝑁 𝑡𝑒𝑟𝑚𝑠.

3. Write a program that find whether a given year is a leap year or not.
4. Write a program to print following pattern.
1
22
333
4444
55555
5. Write an automated censor program that reads the text from a file and creates a new file where
all of the four-letter words have been replaced by “****”.
6. Write a program to find the number of times an element occurs in the list.

SMG
Summer 23

1. Write a program to perform the below operations on the list:


 Read n numbers from a user,
 Number of odd numbers,
 Number of even numbers.
2. Create a Python program to display the following patterns using loop concept.

**

***

****

*****

3. Create a Python program to display the following patterns using loop concept.

12

123

1234

12345

4. Write a Python program to perform the below operations on the list:


 Read n numbers from a user,
 Find positive numbers,
 Find negative numbers.
5. Explains how to create a dictionaries in Python. Write a Python program to check if a key exists
in a dictionary. (Summer -23).
6. Explain how to create Dictionary in Python. Write a Python program to concatenate two
dictionaries into a new one.

SMG

You might also like