order of operations exponentiation gets done firstfollowed by multiplication and division (including /and %)and addition and subtraction come last the classic math class mnemonicpemdas (please excuse my dear aunt sally)might be helpful this comes into play in calculating an average say you have three variables xyand zand you want to calculate the average of their values to expression + + / would not work because xy+ division comes before additionyou would actually be calculating instead of this is easily fixed by using parentheses( + + )/ in generalif you're not sure about somethingadding parentheses might help and usually doesn' do any harm random numbers to make an interesting computer gameit' good to introduce some randomness into it python comes with modulecalled randomthat allows us to use random numbers in our programs before we get to random numberswe should first explain what module is the core part of the python language consists of things like for loopsif statementsmath operatorsand some functionslike print and input everything else is contained in modulesand if we want to use something from module we have to first import it--that istell python that we want to use it at this pointthere is only one functioncalled randintthat we will need from the random module to load this functionwe use the following statementfrom random import randint using randint is simplerandint( ,bwill return random integer between and including both and (note that randint includes the right endpoint unlike the range functionhere is short examplefrom random import randint randint( , print' random number between and 'xa random number between and the random number will be different every time we run the program math functions the math module python has module called math that contains familiar math functionsincluding sincostanexploglog factorialsqrtfloorand ceil there are also the inverse trig functionshyperbolic functionsand the constants pi and here is short example