student = ['a', 'b', 'c', 'd', 'e', ' f', ' g' ]
number = 0
import random
while number < 32:
number += 1
print(number, random.choice(student))
input()
While creating a program that sets the order, the value selected as random.choice is not included in the next selection list, so that it is not a duplicate draw. What should I do?
python random
You can remove the pulled items as shown below.
import random
student = ['a', 'b', 'c', 'd', 'e', 'f', 'g' ]
for _ in range(len(student)):
choiceItem = random.choice(student)
student.remove(choiceItem)
print(choiceItem)
539 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
539 Understanding How to Configure Google API Key
537 Unable to install versioned in Google Colab
640 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
545 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.