Python

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

Roll

No.2211 Name:-Tanvi
Kocharekar
Name: vaishnavi prakash bote
Roll No:2167
Section: A

Practical No.1

a) Create a program that asks the user to enter their name and
their age.Print out a message addressed to them that tells them the
year that tells them the year that they will turn 100 years old.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

b) Enter the number from the user and depending on whether the
number is even or odd, print out an appropriate message to the
user.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

c) Enter the number from the user and depending on whether the
number is positive or negative, print out an appropriate message
to the user.
Program:-
Roll
No.2211 Name:-Tanvi
Kocharekar
Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

d] Aim:- Write a program to generate the Fibonacci series.


Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

e] Aim:- Write a python program to generate the various patterns.


i) Star pattern
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

ii) Number pattern


Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

iii) Reverse star pattern


Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
iv) Pyramid star pattern
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
v) Reverse Right-angled triangle pattern.
Program:
- Output:-
vi) Square Pattern.
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
vii) Write a python program to add two numbers from user input.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
viii) Write a python program to calculate to add two numbers
from user input.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
e) i) String Slicing

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
ii) String Slicing using Index Sequence

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
iii) Python code to demonstrate String length using len.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
iv) Python program to show the working of upper() function.

Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
v) Python program to show the working of lower() function.
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
vi) Python program to show the working of title() function.
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
vii) Python program to show the working of swapcase() function.
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
vii)Python program to show the working of capitalize() function.
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
f)Show the use of list in python
Program:-

Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar

f) Leap Year program


Program:-

Output:

g) FActorial number
Program:-
Roll
No.2211 Name:-Tanvi
Kocharekar

Output:

h) Prime Number
Program:
- Output:-

You might also like