I’m currently taking the “Complete Data Analyst Bootcamp” on Udemy and have this problem.
Here is what is asked for an assignment:
Create a For loop that will print all the variables from a given list multiplied by 2. Let the list contain all numbers from 1 to 10. Create it with the help of the range() function.
Here is my code:
for x in range(1,11):
print(x*2, end=" ")
It wouldn’t indent print after I saved
This is the result:
2 4 6 8 10 12 14 16 18 20
It tells me this is incorrect. Could anyone tell me what I’m missing or misunderstanding?
If that was the assignment, you have produced the proper result. If the assignment requires formatting the output differently, it should tell you that.
As far as the formatting of the code, use triple-backticks (`) to surround the code so that it will be formatted properly.