00:01
Right.
00:02
So the question is to write a python program that gets a number using keyboard input.
00:09
I am going to be using python 3 here, so i won't be using raw input.
00:13
If the number is positive, call countdown, negative count up, choose which for zero.
00:18
Okay, so i've gone ahead and taken the liberty of writing these functions ahead of time so that it's faster.
00:24
We can see that countdown and count up are just two different versions of the same function.
00:29
Notice that i have used recursion here.
00:32
So if you're not familiar with recursion, it's where a function calls itself with a base case.
00:39
And if it, the base case in this case is a bit harder to read, but we'll see that it does not call itself if n is negative.
00:53
So in this case, we're just going to input and prompt the user to input an integer.
00:59
This try except, if you're not sure about exceptions yet, then don't worry about this...