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
python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started