0
Integers
please can you help me (python) the user inputs an integer 20 and I want them to see it divided. like so 2, 10, 5, 3
8 Réponses
+ 2
this is very helpful and I am grateful. is it possible for us to work together to make a website?
+ 1
Yes.
"input" will require from the user an information.
But how can Python identify it ?
For that, Python make you ask something. Wait.. you will understand.
example:
I want ask the user to type a number to be divided for 5.
input('Type a number to be divided for 5')
But hoooow can we use this number that ee have got ?
You must identify if before:
number = input ('Type a number...')
Now we can use:
print (number/5)
OUTPUT:
ERRO.
Why ERRO ?
Because you haven't specified what type of input you want in number. It could be a string (default), float (1.0 , 3.4 , 2.8, etc) or int (from integer).
So..
number = int ( input ('Type a number to be divided for 5'))
print (number/5)
if you type 20, the output will be 4.
+ 1
thanks but I meant that I want the number 20 (an input) to be separated into 4 different parts 2 10 5 3 for example.
so if the user inputs 20 he sees it divided like so 2 10 5 3 for example.
+ 1
well I am not particularly a professional myself but we could work something out.
+ 1
I could also all the community which I plan on doing to help us
0
Chek it out: https://code.sololearn.com/cfD12i5NwVfk/?ref=app
0
It answer your question ?
Or you are looking for something like:
input = 20
output
input/2 = 10
input/10 = 2
input/5 = 4
inout/3 = not_integer
[10, 2, 4, ]
0
Yes, sure ! But I'm still learning HTML, I don't know much. What about would be the website ?
How could I help you ?