Flashcards
Untitled
Cards in this deck (7)
- 1what is a code?code is simply a set of ordered instruction for the computer to execute (run)
- 2computer languages (python) have rules just like human languages.for example in English a sentence ends in a full stop and starts with a capital letter# this program prints messages to the screen
strmessage="computer says no"
strone="1.0"
none=1.0
print( strmessage )
print( "1.0+1.0" )
print( strone +strone )
print(1.0+1.0) - 3code syntaxNotice that the Hello.py code is highlighted in many different colours. Python code is made of many components lets look at each of these.
- 4variablesvariables are always set with a = after they are named.
hers a example:
hello.py
strmessage="computer says no"
strone="1.0"
none=1.0 - 5stringsstrings are variable that holds "text".
why must we put "text" in ""? - 6operatorsa operator is something like +,=.
- 7—
Information
- Description
- Flashcards on Untitled, created by Shannyn Wordley on 14/10/2015.
- Created by
- Shannyn Wordley
- Views
- 0
- Rating