HiroEndin
@HiroEndin
I modified @AndrewZhao1 's Whack a Mole!
I originally worked off of their repl, but it's majorly modified.
I worked off an older version, the current
Python
I used a for loop for 99999999 and it prints | then the screen clears, and so on.
Python
CodingCactus instead of a for loop which will eventually end, you can do while True:
also, you probably shouldn't define the clear function every time that you loop, define it outside the loop3 years ago
coderash Yeah, also maybe show 2 in one post because it gets a little annoying when very similar posts are published 2 minutes after the other
3 years ago
How do I make a repl that uses multiple languages?
For example, a repl that uses both Python and HTML.
In a single repl.
VulcanWM Open a repl with the language you need more, for instance Python, then at the corner, there is a file option, click it, and make a HTML file, like random.HTML.
> Please mark this as the answer if you think it is the answer3 years ago
Sorry that I'm posting this again, and I'm also (possibly, it might be fine) sorry that I'm posting this in share!
I'm still looking for more people,
Python
I've got 1 person I know for sure is helping and 1 person I invited.
Who wants to help me make this? Look at the code and see if you can do the type o
Python
How do I make code that will make something have a percentage to happen?
(how do I give something a chance that is a percentage?)
Python
Muffinlavania Umm yea if you want to be nice mark @VulcanWM as the right answer, and he is right, random is still a percentage. It can be looked at as a percentage, fraction, or a decimal
Ex:
random.randint(1,4)= 1/4 = .25 = 25%3 years ago
VulcanWM You should use random
> Please mark this as the answer if you think it is the answer3 years ago
Hi! This is my first quiz and score system! Basic maths, though.
I put colour there too.
I got the colour commands from something @CodingCactus made.
Python
How do I make a key detection command? I tried working off @CodingCactus' 2048 game with keyPress, but it didn't work. How do I make it work?
(I'm as
Python
CoolJames1610 You need to have key = getkey() after the scrolllTXT, then do if key == "q": then etc...3 years ago
CodingCactus You have already imported getkey, now all you need to do is something like:
key = getkey()
if key == 'w':
#move up
elif key == 'a':
#move left
etc.
`3 years ago
Geocube101 This is a probably over-complicated class for detecting keypress events on a sub-thread
https://repl.it/@Geocube101/ASK-Key-Detect
If you have any questions or problems just let me know3 years ago
I keep getting a key error for the code
if films["director"] == films["George Lucas"]:
print(films["year"])
What the code is meant to do is to see i
Python
DynamicSquid print(films"Jurassic Park")
// the compiler doesn't know what this is
if ["director"] != "Steven Spielberg":
print(films[0])
I'm not sure if this works, but try this:
print(films"Jurassic Park")
if films"Jurassic Park" != "Steven Spielberg":
print(films[0])
`3 years ago
How do you make it skip to the next line of code and do nothing if a certain condition is met?
if ask == "A" and whichisit == "object":
print("No."
Python
How do I make my code run again at the end of it?
Python.
CodingCactus put the whole thing in a while loop
e.g.
play = "y"
while play == "y":
#your code for thing goes here
play = input("play again (y/n)").lower()
`3 years ago
Hi. I do Python. Is there a way to print " in a print command? When I type print("Example, " is a symbol") it will only print Example, and not the ",
Python
CodingCactus yes, you can either do this:
print('Example, " is a symbol')
or you can do this:
print("Example, \" is a symbol")3 years ago