mardi 30 avril 2019

How to assign a variable to equal any number

So I am a beginner in learning python. I have been reading “how to automate the boring stuff” and while reading I try writing code to learn better. I’m writing a simple code to multiply any number a user inputs by 10. And it is a while loop so thy can continue doing it if they choose to. I don’t know what to assign my variable “number” to equal any number that the user inputs. Here’s what the code looks like. I’m using my iPhone to do this so I’m using a free app that’s python 2 something I don’t even know lol.

print('What number you want me to multiply by         10?')
number=float(raw_input())
while number==????!!!
     print(number*10)
      number=float(raw_input('Enter new number: '))
else:
     print('Please enter a number next time')

Aucun commentaire:

Enregistrer un commentaire