
Patrick B. answered 07/03/21
Math and computer tutor/teacher
Not allowed to use any built-in functions...
yet at the end, the name of the winning player is to be displayed...
PRINT is a built-in function...
Are we allowed to generate random numbers using randomInt(), as the problem asks?
That too is a built-in random function.
Can you please be more specific as to which built-in functions that are and are NOT
allowed to be used?
Essentially, you can just put the numbers 1 through 7 in an array and scramble it.
That is the order the players shall be eliminated and the LAST element shall be the winner.
import random
import datetime
players = []
for i in range(7):
players.append(i+1)
random.seed(datetime.time())
for i in range(7):
randIndex = random.randint(0,6)
temp = players[i]
players[i] = players[randIndex]
players[randIndex]=temp
for i in range(7):
print(players[i])
print(" Winner is player # " + str(players[6]))
# built-in functions: range, seed,datetime,time(), randint,print

Patrick B.
generate a random int.... call it x. then for i in range(x): dummyX = random.randint() this will set the random # generator to a random position in the sequence07/07/21
Regina T.
what can be used instead of seed? randint is okay but i am not alowed to used datetime.time(). I can use randint here but others are not allowed. please help07/04/21