Skip to content

Python_en_30Dias #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

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 30DaysOfPython_SAML/Day_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Excercise 1

print(3+4) # Addition (+)
print()
28 changes: 28 additions & 0 deletions 30DaysOfPython_SAML/Day_1_hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Excercise 1

print(3+4) # Addition (+)
print(3-4) # Subtraction (-)
print(3*4) # Multiplication (*)
print(3/4) # Division (/)
print(-3%-4) # Modulus (%)
print(3**4) # Exponential (**)
print(3//4) # Floor Division Operator (//)

# Excercise 2

print("Simon") # My Name
print("Mendez") # My Fullname
print("Venezuela") # My Country
print("I am enjoying 30 days of python") # A Sentence

# Excercise 3

print(type(10)) # Integer
print(type(9.8)) # Float
print(type(3.14)) # Float
print(type(4-4j)) # Complex
print(type(["Simon","Python","Venezuela"])) # List
print(type("Simon")) # String
print(type("Mendez")) # String
print(type("Venezuela")) # String
print(type((3,2))) # Tuple
102 changes: 102 additions & 0 deletions 30DaysOfPython_SAML/Day_2_variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Exercise 1

first_name = "Simon"
last_name = "Mendez"
country = "Argentina"
city = "Buenos Aires"
age = 40
# Fecha de nacimiento
dia, mes, año = 22, "Julio", 1983
is_married = True
is_true = "True"
light_on = True
print("____________________________________________________")
print("My name is:", first_name, type(first_name))
print("My surname is:", last_name, type(last_name))
print("Country:", country, type(country))
print("City",city,type(city))
print("age:",age,type(age))
print("Fecha de Nacimiento:",dia,mes,año,type(dia),type(mes),type(año))
print("Married:",is_married,type(is_married))
print("is true:",is_true,type(is_true))
print("light on:",light_on,type(light_on))
print("____________________________________________________")
print("Name Length:",len(first_name))
print("Surname Length:",len(last_name))
print("Name Length:",len(first_name),"Surname Length:",len(last_name))
print("____________________________________________________")
# Definicion de variables
num_one=5
num_two=4
variable_total_suma=num_one+num_two
variable_total_resta=num_one-num_two
variable_total_multiplicacion=num_two*num_one
variable_total_division=num_one/num_two
variable_total_modulo=num_two%num_one
variable_total_exponentiation=num_one**num_two
variable_total_floor_division=num_one//num_two
# Prints de respuestas
print("A:",num_one)
print("B:",num_two)
print("La sumatoria es:",variable_total_suma)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("La resta es:",variable_total_resta)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("El producto es:",variable_total_multiplicacion)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("El cociente es:",variable_total_division)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("El modulo es:",variable_total_modulo)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("La potencia es:",variable_total_exponentiation)
print("____________________________________________________")
print("A:",num_one)
print("B:",num_two)
print("La division entera es:",variable_total_floor_division)
print("____________________________________________________")
# Datos de un circulo
radius=30
pi=3.1416
diameter=2*radius
circle_perimeter=diameter*pi
circle_area=pi*radius**2

print("Radio:",radius)
print("Diametro:",diameter)
print("pi:",pi)
print("Perimetro de la circunferencia:",circle_perimeter)
print("Area de la circunferencia:",circle_area)
print("____________________________________________________")

# Pedir datos del usuario y el radio para calcular todo lo referente al circulo

name=input("Nombre:")
surname=input("Apellido:")
country_=input("Pais:")
city_=input("Ciudad:")
age_=input("Edad:")
print("Fecha de Nacimiento")
day_of_birth=input("Dia:")
month=input("Mes(en letras):")
year_=input("Año:")
married_=input("Estado civil:")
print("____________________________________________________")
print("Nombre:",name)
print("Apellido:",surname)
print("Pais:",country_)
print("Ciudad:",city_)
print("Edad:",age_)
print("Fecha de Nacimiento")
print(day_of_birth,"de ",month,"de ",year_)
print("Estado civil:",married_)
print("____________________________________________________")
Empty file.
29 changes: 29 additions & 0 deletions Curso_MOUREDEV_SAML/00_Hello_SAML.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Comentarios:
# Hello Python

print("Hello Python")

"""Este es un comentario
en muchas, muchas
muchisimas lineas, y hacemos esta prueba"""

print(3+5)

# Ahora vamos a consultar el tipo de dato
print(type('Hello Python'))
print(type(2+3)) #Ejemplo de Suma
print(type(-5-1)) #Ejemplo de Resta
print(type(-3*7)) #Ejemplo de Multiplicacion
print(type(-15/-3)) #Ejemplo de Division
print(type(-2%3)) #Ejemplo de Modulo
print(type(-6**2)) #Ejemplo de Exponencial
print(type(9//4)) #Ejemplo de Division Operador
print(type(True)) #Ejemplo de Booleano
print(type((1,2,3))) #Ejemplo de Tupla
print(type([1, 2, 3])) #Ejemplo de Lista
print(type({'name':'Simon'})) #Ejemplo de Diccinario
print(type({9.8, 3.14, 2.7})) #Ejemplo de Set
print(type((9.8, 3.14, 2.7))) #Ejemplo de Tuple
print(type(1+6j)) #Ejemplo de Complejo

print(type(print("My Text String"))) #Ejemplo Tipo "NoneType"
52 changes: 52 additions & 0 deletions Curso_MOUREDEV_SAML/01_Variables_SAML.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Variable

my_string_variable = "My String Variable"
print(my_string_variable)

my_int_variable = 5
print(my_int_variable)

my_int_to_str_variable = str(my_int_variable)
print(my_int_to_str_variable)
print(type(my_int_to_str_variable))

my_bool_variable = False
print(my_bool_variable)

# Concatenación de variables en un print
print(my_string_variable,my_int_to_str_variable,my_bool_variable)
print(type(print(my_string_variable,my_int_to_str_variable,my_bool_variable)))
print("Este es el valor de:", my_bool_variable)

# Funciones Integradas del Sistema
print(len(my_string_variable))
bus=[115,118,556,721]
print(len(bus))

# Variables en una sola linea. ¡Cuidado con abusar de esta sintaxis!
name, surname, edad, alias = "Simon", "Mendez", 40, "Joker"
print("Mi nombre es:", name, surname,". Alias The ", alias,"y mi edad es:",edad)

# Inputs
"""first_name = input('What is your name: ')
age = input('How old are you? ')
print(first_name)
print(age)"""

"""name = input('Cual es tu nombre: ')
age = input('Cuantos años tienes? ')
print(name)
print(age)"""

# Cambiamos su tipo
name = 40
age = "Simon"
print(name)
print(age)

# ¿Forzamos el tipo?
address = str = "Mi direccioón"
address = True
address = 5
address = 1.2
print(type(address))
17 changes: 17 additions & 0 deletions Curso_MOUREDEV_SAML/02_Operadores_SAML.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Operadores ###

# Operadores Aritmeticos
# Operaciones con Enteros

print(3+4)
print(3-4)
print(3*4)
print(3/4)
print(10%2)
print(10%3)
print(10//3)
print(2**3)


# Operaciones con Cadenas de Textos
print("Hola"+" "+"Python")
27 changes: 27 additions & 0 deletions Curso_MOUREDEV_SAML/Hello_SAML.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Comentarios:
# Hello Python

print("Hello Python")

"""Este es un comentario
en muchas, muchas
muchisimas lineas, y hacemos esta prueba"""

print(3+5)

# Ahora vamos a consultar el tipo de dato
print(type('Hello Python'))
print(type(2+3)) #Ejemplo de Suma
print(type(-5-1)) #Ejemplo de Resta
print(type(-3*7)) #Ejemplo de Multiplicacion
print(type(-15/-3)) #Ejemplo de Division
print(type(-2%3)) #Ejemplo de Modulo
print(type(-6**2)) #Ejemplo de Exponencial
print(type(9//4)) #Ejemplo de Division Operador
print(type(True)) #Ejemplo de Booleano
print(type((1,2,3))) #Ejemplo de Tupla
print(type([1, 2, 3])) #Ejemplo de Lista
print(type({'name':'Simon'})) #Ejemplo de Diccinario
print(type({9.8, 3.14, 2.7})) #Ejemplo de Set
print(type((9.8, 3.14, 2.7))) #Ejemplo de Tuple
print(type(1+6j)) #Ejemplo de Complejo
Empty file.