1038 solution python

Solutions on MaxInterview for 1038 solution python by the best coders in the world

showing results for - "1038 solution python"
Jonathan
14 Apr 2016
1X,Y=list(map(int,input().split()))
2if(X == 1):
3    price  = (float) (4.00 * Y)
4elif(X == 2):
5    price  = (float) (4.50 * Y)
6elif(X == 3):
7    price  = (float) (5.00 * Y)
8elif (X == 4):
9    price  = (float) (2.00 * Y);
10elif (X == 5):
11    price  = (float) (1.50 * Y)
12print(f"Total: R$ {price:.2f}")
Sofia
06 Apr 2019
1import math
2A,B,C = map(float,input().split())
3D = (B**2)-(4*A*C)
4if(D <0 or A==0):
5    print("Impossivel calcular")
6else:
7    D=math.sqrt(D)
8    R1 = (-B+D)/(2*A)
9    R2 = (-B-D)/(2*A)
10    print(f'R1 = {R1:0.5f}\nR2 = {R2:0.5f}')
Linus
12 Aug 2020
1X,Y = map(int,input().split())
2Item = {1:4.0,2:4.5,3:5.0,4:2.0,5:1.5}
3X = float(Item[X])*Y
4print(f"Total: R$ {X:.2f}")