Iot Lab1
Iot Lab1
Name Here")
#print("Please Enter Your
Name Here:\n")) #get the input from console
name = input("Please Enter Your
Bengaluru ##
## ALS, difference, product
P2.
Program to read twO numbers dnd diSplay Sum,
#4 A
and division
Number")
print ("Enter First
num1 = input ()
Number")
print ("Enter Second
num2 = input ()
t *
print ("*** *")
"+str (int (num1 ) +int (num2)))
print ("Sum of Given numbers is :
"+str (int (numl )-int (num2) ))
print ("Difference of Given numbers i s :
"+str(int (numl) *int (num2) ) )
print ("Product of Given numbers is: "+str (int (numl)/int (num2) ) )
print ("Division of Given numbers is :
**** ** ***
* * * * *** * ** n )
nrint (" ******** ****
Word count = 0
character count = 0
while True:
print ("******* ***
choice = input ()
if (choice == '1'):
print ("Enter the Width of the
width = int (input ()) Rectangle in meters")
print ("Enter the height of the
height = int (input()) Rectangle in meters")
print ("The area of a Given
Square meters ") Rectangle is ", width*height
continue
elif (choice == 12'):
print ("Enter the Base value of
base = int (input ()) the Triangle in
mneters")
print ("Enter the height of the
height = int (input () ) Triangle in meters")
print ("The area of a Given
Square meters ") Rectangle is ",
0.5*base*height
Continue
elif ( choice ==3'):
print ("Enter the Radius of the
radius = int (input () ) Circle in meters")
print ("The area of a Given Circle is
", 3.14
Square meters ") *radius*radius
Continue
elif (choice == "4'):
break
else:
print ("Please enter a valid number from
Continue the menu")
: ")
print ("Enter Denominator value
num2 = int (input ())
try:
result = numl/num2
is : ", result)
print ("The Division of Given Numbers
except ZeroDivisionError:
Denominator should not be Zero")
print ("Divide By zero Error. The