Python characters are random

Asked 2 years ago, Updated 2 years ago, 21 views

I want to write letters randomly, not numbers If it's APPLE, BLUE, APPLE BLUE BLUE BLUE APPLE APPLE BLUE APPLE I want to do it randomly like this, can anyone teach me?

python

2022-09-20 22:01

1 Answers

import random

Candidate = ["Banana", "Apple"]
for _ in range(5):
  choice = random.choice(candidate)
  print(choice)


2022-09-20 22:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.