SINTAXISYSEMANTICA. Tengo la impresión de que Java fue diseñado para hacer que fuera difícil escribir mal código, mientras que Python está diseñado para.

1 SINTAXISYSEMANTICA ...
Author: Amado Romano
0 downloads 0 Views

1 SINTAXISYSEMANTICA

2 Tengo la impresión de que Java fue diseñado para hacer que fuera difícil escribir mal código, mientras que Python está diseñado para hacer que sea sencillo escribir buen código. – Magnus Lycka Java y Python

3 Veremos: Ejemplo “hola mundo” Otras formas de escribir “hola mundo” Print y comillas Sintaxis IF Sintaxis ELSE Sintaxis ELIF Sintaxis WHILE DO-WHILE? Sintaxis FOR Python en acción Graphical API for Python Students (GASP) Consultas

4 Hola Mundo! print "hola mundo"

5 hola="hola" mundo="mundo" print "%s %s" % (hola, mundo) print hola, mundo Hola Mundo!

6 hola mundo Hola Mundo!

7 print “hola mundo” print 'hola mundo' print “””hola mundo””” print '''hola mundo''' Print y comillas

8 If : Ejemplo: If a>10: Print “positivo” IF

9 If : Else: ELSE

10 If : Elif : … Elif : Else: ELIF

11 While : DO-WHILE? While true: If : break WHILE

12 For in : Ejemplos: For numero in range(10): For letra in “hola”: For nombre in [pedro, juan, diego]: For (x,y) in [(1,2),(1,3),(1,4)]: FOR

13 PYTHON EN ACCIÓN!