Monday, 14 December 2015

Subject Specialism Training - Day Two 14/12/15

Variables - the computer cannot remember variables like you - you must set them!

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


input stores letters...





Whereas int stores numerical data...



Conversation in Python AND correcting grammar!! 


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:
  1. Highlight code and press tab to indent all code highlighted
  2. Adding \ to code to shorten the width of the window


Random insults!!


No comments:

Post a Comment