0% found this document useful (0 votes)
7 views1 page

User Input for Basic Calculations

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

User Input for Basic Calculations

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#1.

Taking input from the user (name, age, school):

name=input("What is your name?")


age=int(input("How old are you?"))
school=input("Which school do you study in?")

print("My name is:", name)


print("My age is:", age)
print("I study in:", school)

#2. Taking input from the user (finding sum and average of any two numbers):

no1=float(input("First number:"))
no2=float(input("Second number:"))
no3=float(input("Third number:"))

sum=no1+no2+no3
avg=sum/3

print("The average of these numbers is:", avg)

#3. Taking input from the user (finding the area of a parallellogram):

base=float(input("Base: "))
height=float(input("Height: "))

area=base*height

print("The area of the parallellogram is:", area)

You might also like