Skip to content

Instantly share code, notes, and snippets.

View LittleHaku's full-sized avatar
🎸

Iván Sotillo del Horno LittleHaku

🎸
View GitHub Profile
def accum(s):
final = ""
n = 0
length = len(s)
for letter in s:
final += letter.upper() + letter.lower() * n
if length > 1:
final += "-"
n += 1
length -= 1
def nb_year(p0, percent, aug, p, n=0):
while p0 < p:
n += 1
total = p0 + int(p0*(percent/100)) + aug
p0 = total
else:
return n
print(nb_year(1000, 2, 50, 1200))
secret_num = 4
vidas = 0 #Contador
intentos = 3
while vidas<intentos:
intento = int(input("Adivina: "))
vidas += 1
if intento == secret_num:
print("Has acertado")
break
@LittleHaku
LittleHaku / FizzBuzz.py
Created November 8, 2019 18:33
FizzBuzz
def fizz_buzz(n):
if n % 5 == 0 and n % 3 == 0:
print("Fizz Buzz")
elif n % 3 == 0:
print("Fizz")
elif n % 5 == 0:
print("Buzz")
else:
print(n)