Professional Documents
Culture Documents
Python
Python
Python
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
Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
Output:-
Roll
No.2211 Name:-Tanvi
Kocharekar
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
Output:
g) FActorial number
Program:-
Roll
No.2211 Name:-Tanvi
Kocharekar
Output:
h) Prime Number
Program:
- Output:-