0
I wonder how I can fix this
input('Acabei de encontrar a receita ')
print('voce vai precisar dos seguindos ingredientes')
num1 = int('6')
print(num1)
print('Kg de Farinha')
num2 = int('3')
print(num2)
input('Unidades de ovos')
print('')
print('ou add no carrinho')
print('Ok, vou calcular')
print('Voce vai facar com')
calculo = farinha - num1
calculo2 = ovos - num2
print('')
print('Voce vai ficar com {} de farinha e {} de ovos'.format(calculo, calculo2))
As you can see, the flour number is separated from the phrase flour because I need to use the flour number to subtract with what I have, but if I put 2 kg of flour, for example, it will not recognize as number and will give error. I wanted to know how I can use 2 different commands on the same example line:
num1 = int(print('3') print('de farinha')
I don’t understand your doubt.
– Wictor Chaves
What you expect from the user when you do the first
input
? Where the objects are definedfarinha
andovos
? What you expect to receive from the user in the secondinput
? There’s a lot of stuff in your code that didn’t make sense, so there’s no way to answer it clearly. You want to read from the user the value "2 kg flour" or need to display this data on the same line?– Woss