Ask coding questions

← Back to all posts
How to get a random name for your program every time you use the program in Python.
irmat101 (0)
So in the main file on line 14 I am trying to make the program greet you by using your name and by giving the program a random name every time someone opens or uses the program.
Please help me.

malvoliothegood (709)

You can get a list of Christian names off the net, save them into a text file and read them into a list. You can then use the random module and the randint function to choose a name at random. Have a look at this modification of your program: