Question: write a function named count_to_n . This function should take one argument (you can safely assume that all arguments will always be positive integers), and
write a function named count_to_n . This function should take one argument (you can safely assume that all arguments will always be positive integers), and it should print all integer values from 1 to the argument value - one number on each line. This function must use a while loop to count from 1 to the value of the argument. Here are a couple of example calls to the count_to_n function along with the expected print output for that call.
count_to_n(2) # should print out the following:
1 2
count_to_n(3) # should print out the following:
1 2 3
count_to_n(5) # should print out the following:
1 2 3 4 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
