Even when the person gets the password wrong they still get to play the game...
CodingCactus you need to put the whole code in the if indent for it to only be run if they get the username/password right see https://repl.it/@CodingCactus/If-elif-and-else-based-guess-the-number pls ask questions of unsure3 years ago
I made it so the program asks if they want to ply a game. When the person types yes the code keeps repeating non stop.
TheForArkLD add this to end game option="No" And probably,i found incorrect code. Yes = input("Do you want to play a game: ") Change this to option = input("Do you want to play a game: ") ~3 years ago
The slowprint comes out like this: Welcome to guess the number.There will be there rounds.This i s round 1. I'm think of a number 1 through 10. Your g
Can anyone tell me how to make everything after line 9 shorter?
UniqueOstrich18 I've shortened the program to 17 lines: print("Welcome to guess the number.") print("There will be three rounds.") print("This is round 1.") print("(If your guess is incorrect run the code again.)") print("I'm thinking of a number 1 through 10.") def make_guess(number): guess = int(input("Your guess: ")) if number == guess: print("Correct!") else: print("Incorrect...") numbers = [7,4,6] counter = 0 for number in numbers: counter = counter + 1 print("Round "+ str(counter)) mak3 years ago
Codejira def tell_player(): print("Correct") if num == var else print("Incorrect") Also line 9 will raise a SyntaxError. Delete it. One of the greatest benefits of functions is that they can be used several times. Define one at the top of your code and call it whenever needed.3 years ago
Can anyone tell me how to make all the text print as "slowprint"?
AlexanderLuna thanks for the help everyone3 years ago
xolyon here is a function I made a while back import os import sys import time def SlowPrint(text,ti): for char in text: sys.stdout.write(char) sys.stdout.flush() #change this to print to print vertically time.sleep(ti) `3 years ago
AraAra from os import system, name import sys def sprint(str): for c in str + '\n': sys.stdout.write(c) sys.stdout.flush() time.sleep(0.0821) sprint("your text goes here")3 years ago