Counting up to a number input by a user

This is the place for queries that don't fit in any of the other categories.

Counting up to a number input by a user

Postby niccistarr » Fri Apr 25, 2014 7:57 pm

1. Write a program that:
a. Asks the user for a number
b. Inputs a number from the user
c. Counts from 1 to the number the user inputs
d. BONUS: if the user enters a number less than one, the program counts backwards down to the number the user entered.

I am trying to create a program that follows all the above guidelines. I have very little knowledge of programming. Can I get a very basic explanation of how to accomplish this?
Last edited by micseydel on Sat Apr 26, 2014 12:13 am, edited 1 time in total.
Reason: Locked.
Posts: 1
Joined: Fri Apr 25, 2014 7:53 pm

Re: Counting up to a number input by a user

Postby metulburr » Fri Apr 25, 2014 8:11 pm

check out the for loop and built in range()
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 2105
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot], Roobiks, Yahoo [Bot] and 5 guests