# convert float to int
x=3.1415
y=int(x)
print(y) #outputs 3
# convert float to int
int(2.0) #output :2
#this is a int
the_int = 41
#this is a float
the_float = 3.937266272812163518356278
int(your_number)
float1=1.2345
int1=int(float1)
a = 5
a = float(a) # int to float
floatNum = float(intNum)
pi = 3.14 # float number
print(type(pi))
# Output class 'float'
# converting float integer
num = int(pi)
print("Integer number:", num)
# Output 3
print(type(num))
# Output class 'int'
print int(2.3) # "2"
print int(math.sqrt(5)) # "2"
def aud_brl(amount, From, to):
ER = 0.42108
if From.strip() == 'aud' and to.strip() == 'brl':
result = amount/ER
elif From.strip() == 'brl' and to.strip() == 'aud':
result = amount*ER
print(result)
def question():
amount = float(input("Amount: "))
From = input("From: ")
to = input("To: ")
if (From == 'aud' or From == 'brl') and (to == 'aud' or to == 'brl'):
aud_brl(amount, From, to)
question()
a_int = 24
#this is a int
a_float = 3.2883
#this is a float. you can see that it has a difference. it has a . :)