[Solved] What are the possible ways to create a list containing 50 ones in python? [duplicate]


Here are hundreds of ways to do this. I think one of the simplest ones is using list comprehension, like:

ones = [1 for i in range(50)]

3

solved What are the possible ways to create a list containing 50 ones in python? [duplicate]