How would you get a piece of code to print the numbers 1 to 10

(Best) Create a loop:for loop with the range() or assigning a variable iwhile loop with variable(Okay) Create a function that prints 1 to 10(Least) Manually write it out

TD

Related Python Mentoring answers

All answers ▸

Explain why creating a list of several instances of one element using something like my_list = [a] * 5 can result in strange behaviour


How do you define a class in python


how to compute the factorial of a number.


Write a python function that takes a string as parameter and returns the character in the string with the most occurrences, along with the number of times this character occurs