PYTHON DICTIONARY
CommentsData typesVariablesIf ElseIf Elif ElseFunctionsFor loopWhile loopData structuresString slicing/indexingUser defined functionLocal/Global variableValidation and TryMethodsFile I/OPseudocodeModules |
What are modules?
Want to see your modules? try this:Try this moduleRandom module - random integerLook at the following code, then run it to see the out out. Now run it again
Random module - random floatLook at the following code, then run it to see the out out. Now run it again
Random module - random.randomLook at the following code, then run it to see the out out. Now run it again
Random module - random value from a list or 1D arrayLook at the following code, then run it to see the out out. Now run it again
Python challenge - Random moduleEnter the following code in a Python code editor. Before running the code, what do you think it will do? Press "F5" then "Enter" to runn
In this example the module called "random" is imported. random.randint generates a random integar. Change the 6 to a higher number and test the code.
Challenges using random...See if you can code the following programs:
More modules.... |