Skip to content

Instantly share code, notes, and snippets.

View ALXTorresC's full-sized avatar

Alexis Torres ALXTorresC

  • ImaginationForge
  • Concepción, Chile
View GitHub Profile
@ALXTorresC
ALXTorresC / exercise004.py
Created January 17, 2018 03:52
Ejercicio004
#-*- coding: utf-8 -*-
def divisors(x):
lista=range(1,x+1)
listb=[]
for i in lista:
if x % i == 0:
listb.append(i)
return listb
@ALXTorresC
ALXTorresC / exercise003.py
Created January 17, 2018 00:01
Ejercicio003
#-*- coding: utf-8 -*-
a = [1,2,3,4,3,2,1,2,3,4,5,6,7,9,8,7,6,7,8]
def contador(a, x):
b = []
for i in a:
if i <= x:
b.append(i)
return b
## Code for exercise 002
#-*- coding: utf-8 -*-
pattern = 2
print("Par o impar\n---------")
number = int(input("Ingrese un número: "))
message = "par" if (number % pattern == 0) else "impar"
pattern = 4
#-*- coding: utf-8 -*-
factor = 100
def calculate(age, factor):
return age + factor
if __name__ == "__main__":
name = raw_input("ingresa tu nombre: ")
age = int(input("ingresa tu edad: "))