Changes between Version 134 and Version 135 of ControlSystems/SoftwareTeam/IntroToPython
- Timestamp:
- Sep 4, 2017, 11:58:29 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/IntroToPython
v134 v135 17 17 Python, like every programming language, has a structure. Here are the big parts: 18 18 19 * ''Variables'': Things you assign to and read from. Like in Algebra. `a="Dump Truck"` sets the variable `a` to the string "Dump Truck". You can set them to numbers toor fancy things like lists. They're basically the nouns.19 * ''Variables'': Things you assign to and read from. Like in Algebra. `a="Dump Truck"` sets the variable `a` to the string "Dump Truck". You can set them to strings/text, numbers or fancy things like lists. They're basically the nouns. 20 20 * ''Control Structures'': These are core programming language instructions like IF this is true THEN do that…. These are a lot like grammar rules, like: use active voice, or use punctuation. They're how you get stuff done. 21 21 * ''Functions'': These do things. They take nouns as arguments, do something, and can return nouns. In `redCar = paintCarRed(blueCar)`, `paintCarRed` is a function. They're the verbs, they do things, and they take variables and return variables. Many functions are built in to Python, but you can (and should) create your own.