-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from cartrotech/main
Crear cartrotech.py
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/cartrotech.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# fizz buzz | ||
|
||
for i in range(100): | ||
|
||
result = '' | ||
if (i+1)%3 == 0 and (i+1)%5 == 0: | ||
result = 'fizzbuzz' | ||
|
||
elif (i+1)%3 == 0: | ||
result = 'fizz' | ||
|
||
elif (i+1)%5 == 0: | ||
result = 'buzz' | ||
|
||
else: | ||
result = str(i+1) | ||
|
||
print(result) | ||
|