For turtle resources: www.pythoncode.co.uk
"Without the colon the bottom falls out of your program!"
Python Practise
User - input
Program - output
print ("hello world")
hello world
Find the line / column by putting your cursor on the line you want
Whereas int stores numerical data...
Decisions using if and else AND forcing letters to be lowercase
Decisions using elif
\n --> new line
Strings using str (good practise - rather than using commas)
Lists....
append adds onto the end
use [ ] brackets to choose from the list
Three types of loops:
finite - runs a set number of times --> seen as a for in Python
infinite - keeps running e.g. traffic lights
conditional - keep running until a condition is met -->seen as a while in Python
Lists Take 2...
TWO TOPS TIPS:
- Highlight code and press tab to indent all code highlighted
- Adding \ to code to shorten the width of the window
Random insults!!
No comments:
Post a Comment