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

[Python/hello-world,arrays,i-o,vector] #2

Merged
merged 1 commit into from
Oct 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)