To calculate the number of times that occurred before the number of entries occurred

Asked 2 years ago, Updated 2 years ago, 17 views

Blockquote

**Enter any integer greater than or equal to 30:

The number of times 0 occurred is 955.

The number of times 1 has occurred is 966.

. . .

The number of times 31 (number of inputs) occurred is 1000 times

The total number of iterations from 0 to the number 31 you enter occurs 1000 times is ~~.**

Blockquote

The results should come out like this, but I don't know how to plan it <

And

unum=int(input("30 or more of the desired integer):"))

array=list(range(0,unum+1))

When

while((array[unum]-unum)!=1000): I don't know what this means <

python

2022-09-21 10:22

1 Answers

while((array[unum] - unum) != 1000):

It means that there is a unum second element in the list array, subtract the value of unum and repeat the execution statement until it reaches 1000.

I can't answer questions that I don't know how to organize. It's because you don't know where to start and where to go, so you can't even guess where to start explaining.


2022-09-21 10:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.