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 python challenge_14 #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
added challenge_14
  • Loading branch information
Sravanigaju committed Feb 25, 2023
commit 2d4a71aad2ef3cd0aa439e7551b4252fca9b26fa
21 changes: 21 additions & 0 deletions 14_challenge/14_challenge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
We will use this script to teach Python to absolute beginners
The script is an example of is an implementation of the FizzBuzz problem

The problem is:
"""

def fizzbuzz(n):
for i in range(1, n+1):
if i % 3 == 0 and i % 5 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)

n = input("Enter a number: ")
fizzbuzz(n)