This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Lawih/master
[Python/hello-world,arrays,i-o,vector]
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print "Hola mundo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |