I'm pretty new to Python and working on a one and two-player guessing game. Right now I'm working on creating a random number that is the length of digits that the user specifies. I can't seem to figure out a way to make all of the numbers print to one string. They only print out in new lines and one at a time. I think I have a decent concept idea but can't figure out how to make it work. Any advice and help is appreciated. Thank you!
import random
import sys
def p(): #Prints new line quickly
print()
def error(): #Restarts the main
question = input("You have entered an invalid option. Would you like to try again? \n")
if question in ("Yes","yes","y"):
intro()
else:
sys.exit()
def oneplayer():
print("Welcome to the one player mode of the guessing game.")
p()
print("How many digits would you like your number to be?")
SecretNumber=0
FinalNumber = 0
digits=input()
count = 0
while int(digits) > count:
ProduceNewNumber=0
ProduceNewNumber=ProduceNewNumber+random.randrange(10)
count=count+1
SecretNumber=ProduceNewNumber
print(str(SecretNumber))
FinalNumber=(ProduceNewNumber)
def twoplayer():
print("Welcome to the two player mode of the guessing game.")
def intro():
print("Welcome to the guessing game! Would you like to play one player or play with two players?\n")
players = input()
if players in ("1","2"):
if players in ("1"):
oneplayer()
if players in ("2"):
twoplayer()
else:
error()
intro()