Primer commit
This commit is contained in:
commit
20960ae5a9
BIN
Trabajar con repositorios remotos.pdf
Normal file
BIN
Trabajar con repositorios remotos.pdf
Normal file
Binary file not shown.
13
clase_1/1_holamundo.py
Normal file
13
clase_1/1_holamundo.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
print("Hola Mundo soy Cristian Moreno")
|
||||
|
||||
a=5
|
||||
b=10
|
||||
suma= a + b
|
||||
print(suma)
|
||||
#solo es un comentario
|
||||
"""
|
||||
print(suma)
|
||||
print(suma)
|
||||
|
||||
"""
|
||||
print ("Adiós!!")
|
||||
48
clase_1/2_variables_tipos_convertir.py
Normal file
48
clase_1/2_variables_tipos_convertir.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#crear variables
|
||||
texto = "Taller de Programación 2"
|
||||
print (texto)
|
||||
print("-----------------------------")
|
||||
|
||||
|
||||
#reasignar valores
|
||||
texto=1
|
||||
print (texto)
|
||||
|
||||
|
||||
tex = "hola" #texto
|
||||
num = 22 #numero
|
||||
dec = 6.7 #decimal
|
||||
bol= True #booleano
|
||||
lis = [20, 30, 40] #lista
|
||||
lisVar = [20 , "treinta"] #lista variada
|
||||
tuplasNocambia = ("mi diccionario", "mi clave") #tuplas: son inmutables
|
||||
diccionario = {
|
||||
"nombre" : "Cristian",
|
||||
"apellido" : "Moreno" #diccionario: clave - valor
|
||||
}
|
||||
|
||||
|
||||
#imprimir variables
|
||||
print("-----------------------------")
|
||||
print(bol, dec, num, tex, list, lisVar, tuplasNocambia, diccionario)
|
||||
|
||||
|
||||
print("-----------------------------")
|
||||
print(type(bol)) #tipo de variable
|
||||
|
||||
|
||||
#concatenar
|
||||
print("-----------------------------")
|
||||
tex2= "Mundo"
|
||||
print (tex + " " + tex2)
|
||||
print (f"{tex} {tex2}")
|
||||
print ("Bienvenidos, {} {}".format(tex,tex2))
|
||||
|
||||
|
||||
#convertir tipos de datos
|
||||
palabra = "soy un texto"
|
||||
numerico = 25
|
||||
print(palabra + " " + str(numerico))
|
||||
a_texto= str(numerico)
|
||||
a_entero= int(a_texto)
|
||||
a_float = float(a_entero)
|
||||
22
clase_1/3_operadores.py
Normal file
22
clase_1/3_operadores.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
numero1= 10 #operador de asignación
|
||||
numero2 = 5
|
||||
|
||||
#operadores aritméticos
|
||||
resta= numero1 - numero2
|
||||
suma= numero1 + numero2
|
||||
producto = numero1 * numero2
|
||||
division = numero1 / numero2
|
||||
resto = numero1 % numero2
|
||||
|
||||
print("la Resta es ", resta)
|
||||
print("la suma es ", suma)
|
||||
print("el producto es", producto)
|
||||
print("la division es", division)
|
||||
print("el resto es", resto)
|
||||
|
||||
#incremento
|
||||
numero1 += 1
|
||||
numero2 -= 1
|
||||
|
||||
print(numero1, numero2)
|
||||
|
||||
6
clase_1/4_entrada_salida.py
Normal file
6
clase_1/4_entrada_salida.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#entrada
|
||||
nombre = input("¿Cuál es su nombre: ")
|
||||
edad = input ("¿Cuál es tu edad?: ")
|
||||
|
||||
#salida
|
||||
print("Bienvenido: ", nombre + " " + "veo que tienes: ", edad + " Años")
|
||||
55
clase_1/5_condicionales.py
Normal file
55
clase_1/5_condicionales.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#if else
|
||||
color = "verde"
|
||||
|
||||
if color == "rojo" :
|
||||
print ("el color es rojo")
|
||||
else :
|
||||
print ("el color no es rojo")
|
||||
|
||||
|
||||
#Operadores de comparación
|
||||
"""
|
||||
== igual
|
||||
!= distinto
|
||||
< menor que
|
||||
> mayor que
|
||||
<= menor o igual que
|
||||
>= mayor o igual que
|
||||
and Y
|
||||
or O
|
||||
! Negación
|
||||
not No
|
||||
"""
|
||||
|
||||
#if anidados
|
||||
|
||||
edad= 5
|
||||
mayoria_edad= 18
|
||||
nacionalidad= "Argentino"
|
||||
|
||||
if edad >= mayoria_edad :
|
||||
print("es mayor de edad")
|
||||
if nacionalidad == "Europeo":
|
||||
print("es Europeo")
|
||||
else:
|
||||
print("es Argentino")
|
||||
|
||||
else :
|
||||
print ("es menor de esdad")
|
||||
|
||||
|
||||
#elif
|
||||
|
||||
dia=7
|
||||
if dia == 1:
|
||||
print("Es Lunes")
|
||||
elif dia == 2 :
|
||||
print ("Es Martes")
|
||||
elif dia == 3 :
|
||||
print ("Es Miercoles")
|
||||
elif dia == 4 :
|
||||
print ("Es Jueves")
|
||||
elif dia == 5 :
|
||||
print ("Es Viernes")
|
||||
else:
|
||||
print("es fin de semana")
|
||||
14
clase_1/6_bucles.py
Normal file
14
clase_1/6_bucles.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#bucle for
|
||||
contador= 0
|
||||
resultado=0
|
||||
|
||||
for contador in range(0,5) :
|
||||
print ("voy por el: ", contador)
|
||||
resultado= resultado + contador
|
||||
print("el resultado es: ", resultado)
|
||||
|
||||
#bucle while
|
||||
contador2 = 0
|
||||
while contador2 <= 5:
|
||||
print("contador de while", contador2)
|
||||
contador2 +=1
|
||||
BIN
hoja de ruta.png
Normal file
BIN
hoja de ruta.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
python.png
Normal file
BIN
python.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Loading…
Reference in New Issue
Block a user