Python – How to return an empty list in python

How to return an empty list in python… here is a solution to the problem.

How to return an empty list in python

< partition >

I’m trying to call a function that will empty the two lists I sent as arguments.
How do I start emptying the list inside a function and making sure they are empty once my code starts reusing them in Python’s original functions? Below is the code I used as a large system test run.

def Input():
    nextRound = ['Dad', 'Mom']
    maleNames = ['son', 'James', 'Mick', 'Dad']

a = int(input('Enter a number please'))
    if a == 1:
        ErrorInput(1, nextRound, maleNames )
        # I want the below to print two empty strings
        print(nextRound, maleNames)

def ErrorInput(error, namelist, round):

if error == 1:
        print('ERROR: You have entered a number above what is impossible to 
        score')
        namelist = []
        round = []
    elif error == 2:
        print('ERROR: You Have entered a score meaning both players win')
        namelist = []
        round = []
    elif error == 3:
        print('ERROR: You have entered a score meaning neither of the two 
        players win')
        namelist = []
        round = []
    elif error == 4:
        print('EEROR: You have entered a negative number, this is 
        impossible')
        namelist = []
        round = []

return(namelist, round)

Input()

Related Problems and Solutions