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

22nd Oct 2017, 8:33 PM
Smart
8 Respuestas
+ 2
this is very helpful and I am grateful. is it possible for us to work together to make a website?
24th Oct 2017, 3:04 PM
Smart
+ 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.
22nd Oct 2017, 8:46 PM
▲TopGun ▲
▲TopGun ▲ - avatar
+ 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.
23rd Oct 2017, 6:40 PM
Smart
+ 1
well I am not particularly a professional myself but we could work something out.
25th Oct 2017, 10:46 AM
Smart
+ 1
I could also all the community which I plan on doing to help us
25th Oct 2017, 10:46 AM
Smart
23rd Oct 2017, 8:13 PM
▲TopGun ▲
▲TopGun ▲ - avatar
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, ]
23rd Oct 2017, 8:17 PM
▲TopGun ▲
▲TopGun ▲ - avatar
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 ?
25th Oct 2017, 1:26 AM
▲TopGun ▲
▲TopGun ▲ - avatar