Skip to content

Commit

Permalink
Python code (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishi1999 authored and MadhavBahl committed Dec 20, 2018
1 parent bda3c41 commit 464f194
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Day1/Python3/fizzbuzz.py
@@ -0,0 +1,11 @@
n = int(input("Enter number of digits: "))

for i in range(1, n):
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)
25 changes: 25 additions & 0 deletions Day1/README.md
Expand Up @@ -147,3 +147,28 @@ int main()
return 0;
}
```

## Python(3) Implementation

### [fizzbuzz.py](./Python3/fizzbuzz.py)

```c
'''
* @author: Hrishi Patel <hrishipatel99@gmail.com>
* @github: https://github.com/hrishi1999
* @date: 20/12/2018
'''

n = int(input("Enter number of digits: "))

for i in range(1, n):
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)
```

0 comments on commit 464f194

Please sign in to comment.