Nov-01-2016, 04:29 AM
For starters:
Your number1 code
also you don't need the elif it does nothing.Why would you have to make a variable equal to itself?
You should also refrain from using globals, but that's something you will pick up with experience ... just keep it in the back of your mind.
In addition, if you're going to the trouble of naming something 'number'... don't store anything but numbers in that variable
finally, you never call this function, so why is it there? and even if you did, you never look for an 'a'
to execute a function, the syntax is functionname(arguments). I think you are confused about this.
defaults should only be used if they make sense, not as a standard way to call a function.
your final_product is a good example of BAD code.
Try fixing things up a bit, then come back with specific issues.
also, next time post the code here (unless it's mile long)
Your number1 code
number1 = raw_input("Choose a number.") def number1(): if number1 <= 1: number1 = "a" elif number1 > 1: number1 = number1Very confusing and potential for error exists (even though technically legal) when variables are named the same as functions
also you don't need the elif it does nothing.Why would you have to make a variable equal to itself?
You should also refrain from using globals, but that's something you will pick up with experience ... just keep it in the back of your mind.
In addition, if you're going to the trouble of naming something 'number'... don't store anything but numbers in that variable
finally, you never call this function, so why is it there? and even if you did, you never look for an 'a'
to execute a function, the syntax is functionname(arguments). I think you are confused about this.
defaults should only be used if they make sense, not as a standard way to call a function.
your final_product is a good example of BAD code.
Try fixing things up a bit, then come back with specific issues.
also, next time post the code here (unless it's mile long)