0

generate random number ,c

write a program to generate a 5-digit random number each time than subtract one unit form each of the larger 5 digits for example: 24754 Become>>>24654 Or 86219 Become>>>75218

19th Apr 2020, 4:54 AM
Mr.robot
Mr.robot - avatar
5 Answers
0
you can try random module
19th Apr 2020, 6:31 AM
1337ca
0
import random numbers = ["0" , "1" , "2" , "3", "4", "5", "6", "7" , "8" , "9"] x = random.choice (numbers) print(x)
19th Apr 2020, 6:32 AM
1337ca
0
but you must enter length of number
19th Apr 2020, 6:32 AM
1337ca
0
19th Apr 2020, 6:33 AM
1337ca
0
â˜șâ˜șâ˜șâ˜ș it is just random i want 58724 >>57624 Or 97769 >>86658
19th Apr 2020, 7:03 AM
Mr.robot
Mr.robot - avatar