Apr-19-2017, 10:01 PM
Hey guys so I am running into a problem with my code:
Basically I need to write a code that prompts for two numbers (Limit and Copies) and then writes all the numbers from 1 (startvalue) up to and including Limit, Copies number of times and I also need to use nested loops.
Then I have to write a function that that prints out a row of numbers separated by tabs, from (startvalue) to and including limit.
So far I have something looking like this..
e.g 1 2 3 4 5
Basically I need to write a code that prompts for two numbers (Limit and Copies) and then writes all the numbers from 1 (startvalue) up to and including Limit, Copies number of times and I also need to use nested loops.
Then I have to write a function that that prints out a row of numbers separated by tabs, from (startvalue) to and including limit.
So far I have something looking like this..
startvalue = (1) limit = int(input("Please enter a limit")) copies = int(input("How many copies would you like?")) list = [startvalue,limit] for i in range (copies): print (startvalue,limit)
Please enter a limit3 How many copies would you like?2 1 3 1 3So I guess I just want to know how to print the numbers say from 1 to 5 in a row depending on how many copies I input e.g 3 copies
e.g 1 2 3 4 5