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

Added challenge 14 #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions 14_challenge/14_challenge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
We will use this script to teach Python to absolute beginners
The script is an example of Fizz-Buzz implemented in Python

The FizzBuzz problem:
For all integers between 1 and 99 (include both):
# print fizz for multiples of 3
# print buzz for multiples of 5
# print fizzbuzz for multiples of 3 and 5"
"""

def fizzbuzz():
three_mul = 'fizz'
five_mul = 'buzz'
num1 = 3
num2 = 5
for i in range(1, max_num):
if i % num1 == 0 and i % num2 == 0:
print(i,three_mul+five_mul)
elif i % num1 == 0:
print(i,three_mul)
elif i % num2 == 0:
print(i,five_mul)

if __name__=='__main__':
fizzbuzz(100)
Binary file added 14_challenge/positional_argument_error.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.