Skip to content
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

Reto #1 - Python #246

Merged
merged 4 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/cdnexx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
for i in range(100):
n = i + 1
if n % 3 == 0 and n % 5 == 0:
print(f'({n}) fizzbuzz\n')
elif n % 3 == 0:
print(f'({n}) fizz\n')
elif n % 5 == 0:
print(f'({n}) buzz\n')
else:
print(f'({n})\n')
19 changes: 19 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/cdnexx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
leet_dictionary = {'A': '4', 'B': 'I3', 'C': '[', 'D': ')', 'E': '3', 'F': '|=', 'G': '&', 'H': '#', 'I': '1',
'J': ',_|', 'K': '>|', 'L': '1', 'M': '/\/\\', 'N': '^/', 'O': '0', 'P': '|*', 'Q': '(_,)',
'R': 'I2',
'S': '5', 'T': '7', 'U': '(_)', 'V': '\/', 'W': '\/\/', 'X': '><', 'Y': 'j', 'Z': '2', '0': 'o',
'1': 'L', '2': 'R', '3': 'E', '4': 'A', '5': 'S', '6': 'b', '7': 'T', '8': 'B', '9': 'g'}


def txt_to_leet(txt_string):
new_text = ''
for i in txt_string:
try:
new_text += leet_dictionary[i]
except: # Si el caracter no está en el diccionario, simplemente lo agrega al nuevo string
new_text += i
print(new_text)


txt = 'Hola mundo! Mi nombre es cdnexx.'
txt_to_leet(txt.upper())