Karteikarten
Ohne Titel
Karten in diesem Stapel (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—
Informationen
- Beschreibung
- Karteikarten am Ohne Titel, erstellt von Shannyn Wordley am 14/10/2015.
- Erstellt von
- Shannyn Wordley
- Aufrufe
- 0
- Bewertung