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

Python Program Assessment 1 1

The document contains a series of Python programming exercises that involve basic arithmetic operations, including addition, multiplication, simple interest calculation, temperature conversion, and percentage calculation of marks. Each exercise includes a brief description followed by the corresponding Python code. The programs demonstrate user input handling and basic mathematical operations.

Uploaded by

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

Python Program Assessment 1 1

The document contains a series of Python programming exercises that involve basic arithmetic operations, including addition, multiplication, simple interest calculation, temperature conversion, and percentage calculation of marks. Each exercise includes a brief description followed by the corresponding Python code. The programs demonstrate user input handling and basic mathematical operations.

Uploaded by

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

Python Program Assessment 1

1.Write a program in python to accept two numbers


from user and display addition.
Code:
A=int(input("Enter First Number="))
B=int(input("Enter Second Number="))
C=A+B
print("The Addition of ",A," and ",B," is : ",C)
2. Write a program in python to accept three numbers
form user and multiply three numbers.
Code:
A=int(input("Enter First Number="))
B=int(input("Enter Second Number="))
C=int(input("Enter Third Number="))
D=A+B+C
print("The Addition of ",A," and ",B," and ",C," is : ",D)
3. Write a program to accept principal amount, rate of
interest and time from user, calculate and display simple
interest.
Code:
A=int(input("Enter initial balance="))
B=int(input("Enter rate="))
C=int(input("Enter time="))
D=A*(1+(B/100)*C)
print("The Interest is: ",D)
4. Write a program to accept temperature in Celsius
and convert it to Fahrenheit.
Code:
A=int(input("Enter Temperature in Celcius="))
D=(9/5)*A+32
print("The Temperature is: ",D)
5. Write a program to accept two numbers from user and
display its addition without using + sign anywhere in the
code part (Apply your mathematical logic).
Code:
A=int(input("Enter First Number="))
B=int(input("Enter Second Number="))
C=A^B
print("The Addition of ",A," and ",B," is : ",C)
6. Write a program to accept 5 subjects marks from user calculate total
marks, percentage and display it to the user.
Code:
S=int(input("Enter Highest possible marks="))
A=int(input("Enter Maths="))
B=int(input("Enter Physics="))
C=int(input("Enter Chemistry="))
D=int(input("Enter English="))
E=int(input("Enter Computer Science="))
F=A/S*100
G=B/S*100
H=C/S*100
I=D/S*100
J=E/S*100
K=(A+B+C+D+E)/5
print("The persontage of your Maths marks are ",F)
print("The persontage of your Physics marks are",G)
print("The persontage of your Chemistry marks are",H)
print("The persontage of your English marks are",I)
print("The persontage of your Computer Science marks are",J)
print("The overall persontage is ",K)

You might also like