Hey,
I am coding a song guessing game and at the moment i have succeeded. But i have a problem. When the code starts and allows the user to guess the song, it shows the user what the full name of the song is.
For example:
==============================================
Ruin My Life
by Zara Larsson
==============================================
What is the song called?
==============================================
but i would like it to look like this:
==============================================
R___ M_ L___
by Zara Larsson
==============================================
What is the song called?
==============================================
How do i do this exactly?

(If you need the full code then here is the pastebin link: https://pastebin.com/6mzLnfaK)
I am coding a song guessing game and at the moment i have succeeded. But i have a problem. When the code starts and allows the user to guess the song, it shows the user what the full name of the song is.
For example:
def main(): playerScore=0 guessCounter = 0 # This is where you can change the max turns and guesses maxTurns=999999999 maxGuesses = 2 while True: randNum = int(random.randint(0, 19)) f=open('Songs.txt') linesa=f.read().splitlines() g=open('Artists.txt') linesb=g.read().splitlines() for turnCounter in range(maxTurns): randNum = int(random.randint(0, 19)) f=open('Songs.txt') linesa=f.read().splitlines() g=open('Artists.txt') linesb=g.read().splitlines() # Pick a random song: print('==============================================') randsong =(linesa[randNum]) randart =(linesb[randNum]) print(randsong) print(randart) print('==============================================') # Prompt for a guess: songGuess = input("What is the song called?\n==============================================\n>> ")This code would output a random song from a text file but it would out put it like this:
==============================================
Ruin My Life
by Zara Larsson
==============================================
What is the song called?
==============================================
but i would like it to look like this:
==============================================
R___ M_ L___
by Zara Larsson
==============================================
What is the song called?
==============================================
How do i do this exactly?



(If you need the full code then here is the pastebin link: https://pastebin.com/6mzLnfaK)