Ask your own question, for FREE!
Computer Science 7 Online
Vocaloid:

python raffle code

Vocaloid:

|dw:1548084422014:dw|

Vocaloid:

@Ultrilliam this is the code I wrote for @Shadow's essay contest, can you take a look? Suggestions for what I can change/improve?

Vocaloid:

```python import random L = list() user_count = int(input('How many people are in the contest?')) for i in range(user_count): username1 = input('Enter the username: ') score1 = int(input('Enter their score: ')) for i in range(score1): L.append(username1) print("The winner(s) is(are): "+random.choice(L)) ```

Ultrilliam:

This should do: ``` import random L = list() user_count = int(input('How many people are in the contest? ')) win_count = int(input('How many people win the contest? ')) winners = str(); for i in range(user_count): username1 = input('Enter the username: ') score1 = int(input('Enter their score: ')) for i in range(score1): L.append(username1) for i in range(win_count): winners += " " + random.choice(L); print("The winner(s) are: "+winners) ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!