PYTHON DICTIONARY
CommentsData typesVariablesIf ElseIf Elif ElseFunctionsFor loopWhile loopData structuresString slicingUser defined functionLocal/Global variableValidation and TryMethodsFile I/OPseudocodeModules |
What is a Variable?Test yourselfBelow are some more examples of using variables. Ask yourself, "What is the name of the variable?" and "What is the value it is storing?" Goodluck.
Wheelybin = "recycling"
The variable is called "Wheelybin" and it is storing the value "Recycling" Healthpercentage = 100
The variable is called "HealthPercentge" and it is storing the value 100 married = true
The variable is called "Married" and it is storing the value True Python challenge - Displaying the value of a variableEnter the following code in a Python code editor then press "F5" then "Enter"
When you run the code, what will it display on the screen?
Python challenge - Displaying the value of two variablesEnter the following code in a Python code editor then press "F5" then "Enter"
When you run the code, what will it display on the screen?
Python challenge - Multiplying the values of two variablesEnter the following code in a Python code editor then press "F5" then "Enter"
When you run the code, what will it display on the screen?
Python challenge - Multiplying by variable nameEnter the following code in a Python code editor then press "F5" then "Enter"
When you run the code, what will it display on the screen?
Python challenge - Changing the value in a variableEnter the following code in a Python code editor then press "F5" then "Enter"
When you run the code, what will it display on the screen?
|