Jump to content
#3.1 Hello Name

message = input("Enter your name: ")
print()
print("Hello", message)

#3.2 Sum of three numbers

num1 = int(input("Enter 1st Number: "))
num2 = int(input("Enter 2nd Number: "))
num3 = int(input("Enter 3rd Number: "))
Sum = num1+num2+num3
print("Sum is: " , Sum)

#3.3 Area of a rectangle

length = float(input("Enter the length of rectangle: "))
breadth = float(input("Enter the breath of rectangle: "))

area = length*breadth

print("Area = " , area)

# 3.4 Body Mass Index

weight = float(input("Enter weight in kg: "))
height = float(input("Enter height in meters: "))
b = weight/height
bmi = round(b, 2) 
print("BMI is: " , bmi)

#3.5 Cube of a number

num = float(input("Enter a number:"))
cube = num*num*num
print("The Cube of",num,"is", cube )

#3.6 Km to Miles

km = float(input("Enter distance in kilometer: "))
mi = km*0.621371
miles = round(mi, 2)
print(km,"in miles is", miles)

#3.7 Tonnes to kg and quintals

tonnes = float(input("Enter tonnes: "))
quintals = tonnes*10
kgs = quintals*100
print(tonnes, "in tonne is", quintals,"quintals and",kgs,"kgs")

#3.8 simple calculator

num1 = float(input("Enter Value 1: "))
num2 = float(input("Enter Value 2: "))

op = input("Enter any on of the following operation [+,-,*,/]: ")

if op == "+":
    result = num1+num2
elif op == "-":
    result = num1-num2
elif op == "*":
    result = num1*num2
elif op == "/":
    result = num1/num2
else:
    print("Wrong Input, Program Terminated")

print("The Result is: " ,result)

#3.9

i = int(input("Enter number"))
fac = 1
while i>0:
    fac=fac*i
    i=i-1
print("Factorial",fac)


 

Link to comment
https://linustechtips.com/topic/1523006-meh/
Share on other sites

Link to post
Share on other sites

<-- thread locked -->

 

Trolling and/or pointless thread.

 

If you wish to discuss coding and programing, you can do so in the programing section of the forum.

Community Standards

Please make sure to Quote me or @ me to see your reply!

Just because I am a Moderator does not mean I am always right. Please fact check me and verify my answer. 

 

"Beast Mode"

Ryzen 7 9800x3d | Arctic Liquid Freeze 3 Pro 360 | MSI X870 Tomahawk Wi-Fi | MSI RTX 5080 Gaming Trio OC | Gskill Flare X5 6000MT/s CL30

1tb WD Black SN850x NVMe | 4tb WD SN850x NVMe | Antec Flux Pro | Be Quiet Pure Power 13 M 1000w | OWC 10gb NIC

 

Dedicated Streaming Rig

 Ryzen 7 3700x | Asus B450-F Strix | 32gb Gskill Flare X 3200mhz | Corsair RM550x PSU | MSI Ventus 3060 12gb | 250gb 860 Evo m.2

Phanteks P300A |  Elgato HD60 Pro | Avermedia Live Gamer Duo | Avermedia 4k GC573 Capture Card

 

Link to comment
https://linustechtips.com/topic/1523006-meh/#findComment-16057092
Share on other sites

Link to post
Share on other sites

Guest
This topic is now closed to further replies.

×