Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from Lawih/master
Browse files Browse the repository at this point in the history
[Python/hello-world,arrays,i-o,vector]
  • Loading branch information
Gerson Lázaro authored Oct 17, 2017
2 parents e6a9d25 + 477cbcc commit f42077f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions langs/Python/arrays
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = [None] * 100 # Creación
b = [1,2,3,4,5] # Creación con inicialización

a[5] = 34; # Acceso y modificación
1 change: 1 addition & 0 deletions langs/Python/hello-world
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print "Hola mundo"
7 changes: 7 additions & 0 deletions langs/Python/input-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
a = int(raw_input("Ingrese numero: ")) # Lee un entero
b = raw_input("Ingrese string: ") # Lee un string
# En python, siempre se lee toda la línea

# Salida de datos
print "Sin salto de linea"
print "Con salto de linea\n"
14 changes: 14 additions & 0 deletions langs/Python/vector
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Declaración e inicialización
a = []
# Inserción
a.append(32)
# Obtener valor en un índice dado
a[1]
# Modificar el elemento dado(0) con el valor dado(25)
a[0] = 25
# Borrar valor en un índice dado
del a[1]
# Borrar todo
del a[:]
# Obtener tamaño
len(a)

0 comments on commit f42077f

Please sign in to comment.