Question: This is a Python programming question. Could you please show me what is wrong with my code. I want to generate a list of 20
This is a Python programming question.
Could you please show me what is wrong with my code. I want to generate a list of 20 numbers from 1 to 20. Please do not completely rewrite the code, just show me how my code can be fixed.
random_list = []
for num in range(20):
mystery_number = random.random()
mystery_number = math.ceil((mystery_number * 20))
random_list = random_list.append(mystery_number)
print(random_list)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
