Fichas
Sin título
Fichas del conjunto (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—
Información
- Descripción
- Fichas sobre Sin título, creado por Shannyn Wordley el 14/10/2015.
- Creado por
- Shannyn Wordley
- Visitas
- 0
- Valoración