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

Practical File

The document contains several Python programs that perform various tasks, including calculating the area of a square and a circle, determining the day of the week based on a number input, calculating electricity bills based on usage, computing the exponential of the sum of two numbers, generating a multiplication table, and printing a sequence of numbers. Each program prompts the user for input and outputs the result accordingly. The programs demonstrate basic programming concepts such as conditionals, loops, and mathematical operations.

Uploaded by

aryanmalik.hry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Practical File

The document contains several Python programs that perform various tasks, including calculating the area of a square and a circle, determining the day of the week based on a number input, calculating electricity bills based on usage, computing the exponential of the sum of two numbers, generating a multiplication table, and printing a sequence of numbers. Each program prompts the user for input and outputs the result accordingly. The programs demonstrate basic programming concepts such as conditionals, loops, and mathematical operations.

Uploaded by

aryanmalik.hry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Practical

file
Program 1
Program to find area of square
import math
a=float(input("enter the number:"))
b=math.pow(a,2)
print("area of square =",b)
Program 2 AREA OF
CIRCLE
import math
r=float(input("enter radius:"))
a=3.14159*math.pow(r,2)
print("area of circle=",a)
Program 3 Day of week
n=int(input("enter the number:"))
if n==1:
print("monday")
elif n==2:
print("tuesday")
elif n==3:
print("wednesday")
elif n==4:
print("thursday")
elif n==5:
print("friday")
elif n==6:
print("saturday")
elif n==7:
print("sunday")
else:
print("invalid response")
Program 4 electricity bill
a=int(input("enter your electricity usage="))
if a<=100:
print("electricity bill=",a*5)
elif 500>=a>100:
print("electricity bill=",a*10)
elif 1000>=a>500:
print("electricity bill=",a*20)
elif a>1000:
print("electricity bill=",a*100)
else:
print("wrong input")
Program 5Exponential of
modulus power
import math
x=int(input("enter a number x"))
y=int(input("enter a number y"))
a=math.exp(math.fabs(x+y))
print(a)
Program 6 Table of
numbers
a= int(input("enter the number whose table you want:"))
for x in range(1,11,1):
print(a,"X",x,"=",a*x)
Program 7 printing AP
for x in range(1,11,1):
print(x)

You might also like