Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Atharva Python Practical (1)

The document is a practical file for a Python programming course created by Atharva Parab, detailing various programming tasks and exercises. It includes a range of topics such as user input, conditional statements, list operations, file handling, mathematical functions, and GUI development. Each practical section outlines specific programming challenges along with space for code and output documentation.

Uploaded by

mogaveeranishan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Atharva Python Practical (1)

The document is a practical file for a Python programming course created by Atharva Parab, detailing various programming tasks and exercises. It includes a range of topics such as user input, conditional statements, list operations, file handling, mathematical functions, and GUI development. Each practical section outlines specific programming challenges along with space for code and output documentation.

Uploaded by

mogaveeranishan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

PYTHON

PROGRAMMING
Practical File

Name: Atharva Parab


Roll No.: 2813
Class: FYBCA
Division: B
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B

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

b. WAP to display cumulative elements


of a given list: For eg: List is[10,20,30,40]
Output: [10,30,60,100].
c. WAP to remove all odd numbers
from a given list.
d. WAP to accept values from a user and
create a tuple.
4. a. Write a Python script to sort
(ascending and descending) a dictionary
by value.
b. Write a Python script to concatenate
the following dictionaries to create a new
one. Sample Dictionary:
dic1={1:10, 2:20}
dic2={3:30, 4:40}
dic3={5:50,6:60}
Expected Result: {1: 10, 2: 20, 3: 30, 4:
40, 5: 50, 6: 60}
c. Write a Python program to sum all the
items in a dictionary.
5. a. Write a Python program to write and
read from a text file.
b. Write a Python program to append
text to a file and display the text.
c. Write a Python program to write and
read from binary file.
6. a. Write a program that makes use of
built-in mathematical functions.
b. Write a program that makes use of
built-in random module functions.
7. a. Write a recursive function to print the
factorial for a given number.
b. Write a python function to perform
the basic mathematical operations.
c. Write a function that reverses the user
defined value.
d. Write a function to check the input
value is Armstrong and also write the
function for Palindrome.
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B

8. a. Write a python program to study,


define edit arrays and perform arithmetic
operations using array module.
b. Write a python program to generate
an array with numpy and perform
following operations:
- traversing an array
- accessing an array element
- insertion and deletion of element
9. a. Create a GUI based calculator using
the tkinter library.
b. Create a login interface and validate
username and password.
10. a. Write a Python program to plot the
function y = x2 using the matplotlib
visualization libraries.
b. Write a Python programming to
create a pie chart of the popularity of
programming Languages.
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

1. c. Write a program to generate the Fibonacci series.

Code:

Output:
Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B

1. 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.

Code:

Output:
For basic salary less than 1500:

For basic salary more than 1500:


Name: Atharva Parab
Roll No.: 2813
Class: FYBCA
Division: B

1. e. Write a python program to generate the various patterns.

Code:

Output:

You might also like