Jul-25-2018, 05:17 PM
Hello all,
I have difficulty trying to count and print number of loops and implement it as solution number.
The codes are below. Any help would be appreciated!
I have difficulty trying to count and print number of loops and implement it as solution number.
The codes are below. Any help would be appreciated!
def solutionnames(): numofsol= input("How many solutions are there?") listofnames= [] loops=0 for i in range(int(numofsol)): loops +=1 NamesofSol=input("Name of Solution",str(loops)) listofnames.extend([NamesofSol]) print(listofnames) return(listofnames) solutionnames()