0% found this document useful (0 votes)
51 views

Python Assignment

The document contains a set of Python programming assignments divided into 7 sets. The assignments include programs to prompt for user input, perform calculations, string manipulation, working with lists, and other basic Python programming challenges. The goal is to write Python code to solve each problem presented.

Uploaded by

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

Python Assignment

The document contains a set of Python programming assignments divided into 7 sets. The assignments include programs to prompt for user input, perform calculations, string manipulation, working with lists, and other basic Python programming challenges. The goal is to write Python code to solve each problem presented.

Uploaded by

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

Python Assignment

Set- I

1. Write a program that prompts user to enter his first name and last name and then
display a message “Greetings!!! First name Last name”.
2. Write a program to print following message:
Name: -
Father Name: -
Address: -
Mobile No: -
Email ID: -
3. Write a program to print following message:

Let a=10
b=20
O/P: A=10 & B=20
4. Write a program to input 4 numbers after that solved following expression.
(a+b)*c/d
5. Write a program input two numbers after that swap them.

Set- II

6. Write a program input three numbers after that update them adding 4 and
multiplied by 5.
7. Write a program to input principal , rate and time, find Simple Interest.
8. Write a program to input principal , rate and time, find Compound Interest.
9. Write a program to input three sides of triangle find area of triangle using Hero’s
Formula.
10. Write a program to input base and height, find area of triangle
11. Write a program to input length and breadth, find area and perimeter of rectangle.
12. Write a program to input radius, find area and circumference of circle.
13. Write a program to prepare a grocery bill. For that enter the name of the items
purchased, quantity in which it is purchased, and its price per unit. The display bill in
the following format.

***********************Bill*********************
Item Type Item Quantity Price Amount

************************************************

Total amount to be paid:

*************************------********************
14. Write a program to calculate salary of employee given his basic pay (to be entered
by the user) HRA= 10% of basic pay. TA= 10% of basic pay. Find total salary and
display employee record as following criteria.

Name of employee:
Post:
Basic Salary:
HRA:
TA:
Total Salary:
**********************---------************************

Set- III
15. WAP to input two nos. find greatest and smallest number.
16. WAP to input any number, check that number is even or odd.
17. WAP to input any number, check that number is divided by and 2 and 3.
18. WAP to input any number, check that number is divided by and 2 and 3 and not
divided by 4.
19. WAP to input any year, check that year is leap year or not.
20. WAP to input any number, check that number is positive and negative.
21. WAP to input three numbers, find greatest among them.
22. WAP to input week day number after that find corresponding week day name.
23. WAP to input an arithmetic operator and two numbers, after that perform
arithmetic operation as per arithmetic operator.
24. WAP to input five subject marks find total and percentage marks. After that print
remarks as per following criteria.

Criteria Remarks
If percentage>=80 Excellent
If percentage>=70 and less than 80 Very Good
If percentage>=60 and less than 70 Good
If percentage>=50 and less than 60 Average
If percentage<=50 Fail
25. WAP to input age and country origin of employees if age is greater than equal to 18
and Indian, then he/she entitled for voting.
26. Write a program to input type (regular and visiting) and basic salary of employee. If
salary is greater than 50000 and regular then bonus is 5000 else 3000. If salary is less
than 50000 and regular then bonus is 4000 else 2500.
27. Write a program to input age and gender of person. If gender is Male and age is >=21
year then eligible for marriage. If gender is female and age >=18 then eligible for
marriage.
28. A shoe company give monsoon discount as per following chart: -
Company Name Price Discount
>=5000 10%
Nike(Take N or n)
<5000 8%
>=6000 15%
Reebok (Take R or r) >=3000<6000 10%
<3000 7%

Set- IV
29. WAP in Python to print table of a number accepted from user.
30. WAP in python to input any number, find total count of digits
31. WAP in python to input any number, find addition of all digits.
32. WAP in python to input any number, find product of all digits.
33. WAP in python to input any number, find addition of even digits.
34. WAP in python to input any number, find addition of alternate digits.
35. WAP in python to input any number after that reverse it.
36. WAP in python to input any number , check that number is palindrome or not.
37. WAP in python to input any number , check that number is Armstrong or not.
38. WAP in python to print series of Armstrong number from 100 to 999.

Set- V
39. WAP in python to input any number , check that number is prime or not.
40. WAP in python to input any number , find factor of that number.
41. WAP in python to input any number , check that number is strong or not.
42. WAP in python to input any number , check that number is perfect or not.
43. WAP in python to input any number , find factorial of that number.
44. WAP in python to print series of prime number up to n terms.
45. Write a Python program to print the Fibonacci series up to n term.
46. Write a Python program to input two numbers and check it is Amicable or Not.
47. WAP in python to print series of strong number up to n terms.
48. WAP in Python to print following format:

*
**
***
****
*****
49. WAP in Python to print following format:

*****
****
***
**
*
50.
1
12
123
1234
12345

51. WAP in Python to input numbers for user and find average of +ve number only. Take
0 for exit.

Set-VI

52. WAP in python to input any string change it to in upper case.


53. Write a QBASIC program to input a string and count total number of vowels,
consonants, and blank spaces.
54. Write a QBASIC program to input a string and print it in following manner
C
CI
CIM
CIMA
CIMAG
CIMAGE
CIMAG
CIMA
CIM
CI
C

55. WAP in python to input two strings concatenate them second string into first string
56. WAP in python to input any string and redisplay the same string after removal all
vowels.
57. WAP in python to input any string and any character find availability of that
character and position also in string.
58. WAP in python to input any string check string is palindrome or not.
59. WAP in python to input any string find total number of words in that string.
60. WAP in python to input any name and then display it in abbreviated form.
Like: Ranjit Kumar Singh-> R.K.S
61. WAP in python to input any name and then display it in abbreviated form.
Like: Ranjit Kumar Singh-> R.K.Singh
62. Write a QBASIC program to input 10 strings and sort these alphabetically as per
dictionary.

Set-VII (List Related)


63. Write a program to input 5 numbers add all number.
64. Write a program to input 5 numbers add only even number.
65. Write a program to input 10 numbers add even number and multiply odd number.
66. Write a program to input n numbers add only even number. find greatest among
them.
67. Write a program to input 10 numbers, print minimum value.
68. Write a program to input n numbers, print only non-prime number.
69. Write a program to input letters, make a word from those letters.
70. Write a program to input n number of elements remove duplicate value.
71. Write a program to input n numbers after that add extra value at specified locations.
72. Write a program to enter any sentence after that find and print maximum length
word.
73. Write a program to input 5 numbers, after that sort them in ascending order.

You might also like