![Page 1: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/1.jpg)
SINTAXISSINTAXISYY
SEMANTICASEMANTICA
![Page 2: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/2.jpg)
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
![Page 3: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/3.jpg)
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
![Page 4: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/4.jpg)
Hola Mundo!
print "hola mundo"
![Page 5: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/5.jpg)
hola="hola"mundo="mundo"
print "%s %s" % (hola, mundo)print hola, mundo
Hola Mundo!
![Page 6: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/6.jpg)
hola mundo
Hola Mundo!
![Page 7: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/7.jpg)
print “hola mundo”print 'hola mundo'print “””hola mundo”””print '''hola mundo'''
Print y comillas
![Page 8: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/8.jpg)
If <condicion>:<bloque>
Ejemplo:If a>10:
Print “positivo”
IF
![Page 9: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/9.jpg)
If <condicion>:<bloque>
Else:<bloque>
ELSE
![Page 10: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/10.jpg)
If <condicion>:<bloque>
Elif <condicion>:<bloque>
…Elif <condicion>:
<bloque>Else:
<bloque>
ELIF
![Page 11: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/11.jpg)
While <condicion>:<bloque>
DO-WHILE?
While true:<bloque>If <condicion>:
break
WHILE
![Page 12: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/12.jpg)
For <elemento> in <lista_rango_cadena>:<bloque>
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
![Page 13: 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](https://reader036.vdocumento.com/reader036/viewer/2022062309/5665b42c1a28abb57c8fc647/html5/thumbnails/13.jpg)
PYTHON ENPYTHON ENACCIÓN!ACCIÓN!