Professional Documents
Culture Documents
This post is read-only. Explore Repls and connect with other creators on Community. View Community
The info in this post might be out of date, check out our docs instead. View docs
1
Hey! I'm a little lost with this can someone help me please?
LeviAckerman8
@LeviAckerman8/Mastermind
Open on Replit
A Python repl by LeviAckerman8
Voters
LeviAckerman8
RYANTADIPARTHI
4
what have you tried first?
2 years ago
LeviAckerman8
1
@RYANTADIPARTHI Nothing. That's the thing, idk how to do it. I guess if I used a list at the beginning to generate four random numbers then I could use a while loop but how would I go about that?
2 years ago
RYANTADIPARTHI
1
@LeviAckerman8 we aren't supposed to give code, but I'll explain.
Done!
2 years ago
LeviAckerman8
1
@RYANTADIPARTHI Ok so this is what I did for the code: from random import shuffle
Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
def eliminate(how_many):
shuffle(Numbers)
for x in range(how_many):
Numbers.pop(-1)
return Numbers
Numbers = eliminate(5)
2 years ago
Coder100
1
not exactly, you have to generate 4 random numbers, but remember they can repeat @LeviAckerman8
2 years ago
RYANTADIPARTHI
1
@LeviAckerman8 ok, that's good for now. more?
2 years ago
LeviAckerman8
1
@Coder100 It worked for me?
2 years ago
Coder100
1
try this:
https://repl.it/@Coder100/working-repl-bruh-PoliteGoldenrodMemory#main.py
what happens is that you look at the amount correct by setting that to 0, and then you just check if each item matches in the generated array, but then if they do match, you just add correct by 1. Afterward, finally you do it again if the correct wasn't 4
2 years ago
Load more
terms of service mobile app IDE create a repl facebook 100 Days of Code
privacy blog multiplayer docs twitter
subprocessors about community ask for help instagram
DPA careers teams status page discord
US student DPA teams for education hosting python packages
student privacy pricing ghostwriter import from glitch
bounties import from heroku
AI comparison
brand kit
languages