I'm asking you a question because I'm stuck in studying

Asked 2 years ago, Updated 2 years ago, 47 views

Hello, everyone I'm asking you a question because there's a blockage while studying.

For example, set start number 100.

| 1 | A | Use number: 100–119 | 2 | 10 | 8 | A 20 | Use |
| 2 | B | Use number: 120–134 | 12 | 2 | 1 | B 15 used |
| 3 | C | Use number: | 0 | 0 | 0 | Use C 0 |
| 4 | D | Use number: 135–149 | 3 | 4 | 8 | D 15 used |

If I set the start number to 100 like this, I want to apply the total of each list following the usage number, but it doesn't work well. Please answer!

list django python

2022-09-20 11:40

1 Answers

The initial value of the tour is always available. If you think about it carefully, it won't be that difficult. I don't know, but you can just make a few more variables and click on them.

I came up with an example of how you're thinking about this. I hope it's useful.

import random

VaskinLobbins = 131
lastValue = 100

print("Vaskin Lobbins 31!")

while lastValue < VaskinLobbins - 1:
    callNumber = min(random.randint(1, 3), VaskinLobbins - lastValue - 1)
    lastValue = lastValue + callNumber
    print("%d! (now lastValue is %d)" % (callNumber, lastValue))

print("game over")
print("masyora masyo masyora masyo")


2022-09-20 11:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.