Atharva Python Practical (1)
Atharva Python Practical (1)
PROGRAMMING
Practical File
Index
Practical Details Date Signature
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 they will turn 100
years old.
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.
c. Write a program to generate the
Fibonacci series.
d. Conditional Statements: In a company
an employee is paid as under: If his basic
salary is less than Rs. 1500, then HRA =
10% of basic salary and DA = 90% of
basic salary. If his salary is either equal to
or above Rs. 1500, then HRA = Rs. 500
and DA = 98% of basic salary. If the
employee's salary is input through the
keyboard, write a program to find his
gross salary.
e. Write a python program to generate
the various patterns.
2. a. Write a program that takes two lists
and returns True if they have at least one
common member.
b. Write a Python program to display
sum of list elements.
c. Write a program to find even and odd
nos. from given list
3. a. Take a list, say for example this one: a
= [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and
write a program that prints out all the
elements of the list that are less than 5.
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B
Practical 1
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
they will turn 100 years old.
Code:
Output:
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B
1. 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.
Code:
Output:
If num is odd:
If num is even:
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B
Code:
Output:
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B
Code:
Output:
For basic salary less than 1500:
Code:
Output: