383534181-d Int (Input (Enter The Value of Di

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

d = int(input("Enter the value of distance in miles : "))

t1 = (0.75 * d)/40
t2 = (0.25 * d)/55
total= t1+t2
hr = int(total)
min = int(round(total - hr,2) * 100)
print("Time taken to travel",d,"miles is",hr,"hours",min,"minutes")

temp = float(input("Enter temperature value: "))


unit = input("Enter unit identifier (C for Celsius, F for Fahrenheit):")

if (unit == 'C' or unit == 'c'):


f = (temp * 9/5) + 32
print(temp,"Celsius is equivalent to",round(f,1),"Fahrenheit.")
elif (unit == 'F' or unit == 'f'):
c = (temp - 32) * 5/9
print(temp,"Fahrenheit is equivalent to",round(c,1),"Celsius.")
else:
print("Invalid unit identifier. Please enter 'C' or 'F.")

quantity = int(input("Enter the no. of quantity sold :"))


value = int(input("Enter the item value i.e., price per item in Rs :"))
d = float(input("Enter the discount percentage:"))
t = float(input("Enter the tax rate:"))

amt = quantity * value


discounted_amt = (d / 100.0) * amt
discounted_total = amt - discounted_amt
tax = (t / 100.0) * amt
bill = discounted_total + tax

print("\n**************BILL***************")
print("Quantity Sold : \t", quantity)
print("Price per Item : \t Rs.", value)
print("---------------------------------\n")
print("Amount : \t Rs.", amt)
print("Discount : \t Rs.", round(discounted_amt,2))
print("Discounted Total : \t Rs.", round(discounted_total,2))
print("Tax : \t Rs.", round(tax,2))
print("---------------------------------\n")
print("Total Amount : \t Rs.", round(bill,2))

r = int(input("Enter the value of red (0 to 255) :"))


g = int(input("Enter the value of blue (0 to 255) :"))
b = int(input("Enter the value of green (0 to 255) :"))

rn = r / 255.0
gn = g / 255.0
bn = b / 255.0
if rn > gn and rn > bn:
w = rn
elif gn > rn and gn > bn:
w = gn
else:
w = bn
if r == 0 and g == 0 and b == 0:
c = m = y = 0
else:
c = (w - rn) / w
m = (w - gn) / w
y = (w - bn) / w

k = 1 - w

print("The value of cyan is", round(c,4))


print("The value of magenta is", round(m,4))
print("The value of yellow is", round(y,4))
print("The value of black is", round(k,4))

You might also like