-1

This is my code:

print(f" the int of your number is {int(float(input('type in a number: ')))}")

Is there a way to assign a variable based on {int(float(input('type in a number: ')))} so that I can re-use it?

mech
  • 2,775
  • 5
  • 30
  • 38

1 Answers1

0

You'll have to do it in two steps:

float_answer = float(input('type in a number: '))
print(f" the int of your number is {int(float_answer)}")
John Gordon
  • 29,573
  • 7
  • 33
  • 58