View Single Post
  #1 (permalink)  
Old 09-19-2008, 11:01 AM
Xenofon Xenofon is offline
Newbie
 
Join Date: Sep 2008
Posts: 1
Credits: 0
Rep Power: 0
Xenofon is on a distinguished road
Default Need help with 2 simple things

Hi, I just started learning programming and I was told that Python was good for beginners, and after solving just a few problems I'm already stuck...

I'm suppose to make a function that counts down from the number entered and then up again. Using recursion (if). I can make it go either up or down but not both in one function.

For example if i enter 4 it should do this:

4 3 2 1 0 1 2 3 4

The next problem is the same but using iteration (while) instead of recursion.

I know this must be so easy but the answer eludes me. Thanks!
Reply With Quote

Sponsored Links