Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
906fbcf
initialized project and exercise 01
plucodev Sep 18, 2019
f3e1eda
initialized exercise 02
plucodev Sep 18, 2019
aa0b223
initialized exercise 03
plucodev Sep 18, 2019
cba4e25
initialized exercise 04
plucodev Sep 18, 2019
4ca3ef5
initialized exercise 05
plucodev Sep 18, 2019
666c6ce
initialized exercise 06
plucodev Sep 18, 2019
cccf689
initialized exercise 07
plucodev Sep 18, 2019
4806ba1
initialized exercise 08
plucodev Sep 18, 2019
dde938a
initialized exercise 09
plucodev Sep 18, 2019
76b27dc
initialized exercise 10
plucodev Sep 18, 2019
d772cfe
initialized exercise 11
plucodev Sep 18, 2019
7d3f565
initialized exercise 12
plucodev Sep 18, 2019
8764cbb
initialized exercise 13
plucodev Sep 18, 2019
271cca9
initialized exercise 14
plucodev Sep 18, 2019
8856354
initialized exercise 15
plucodev Sep 18, 2019
1eb01f5
initialized exercise 16
plucodev Sep 18, 2019
7244acd
initialized exercise 17
plucodev Sep 18, 2019
70bada7
initialized exercise 18
plucodev Sep 18, 2019
1502e98
initialized exercise 19
plucodev Sep 18, 2019
cd664d4
initialized exercise 20
plucodev Sep 18, 2019
e843f35
initialized exercise 21
plucodev Sep 18, 2019
ab4ddd5
initialized exercise 22
plucodev Sep 18, 2019
a059306
initialized exercise 23
plucodev Sep 18, 2019
63dc9ae
initialized exercise 24
plucodev Sep 18, 2019
3c319f3
initialized exercise 25
plucodev Sep 18, 2019
04db4e3
updated README 01 for Python
plucodev Sep 18, 2019
7830642
updated README 02 for Python
plucodev Sep 18, 2019
96c1a7f
fixed issues
plucodev Sep 18, 2019
199048f
completed 01
plucodev Sep 18, 2019
2331eb7
completed 01
plucodev Sep 18, 2019
b7b45a8
completed 02
plucodev Sep 18, 2019
863093f
completed 03-04-07 and fixed issues
plucodev Sep 18, 2019
494baf0
fixed issues 07
plucodev Sep 18, 2019
67d5020
completed 08
plucodev Sep 19, 2019
6780d10
fixed issues 08
plucodev Sep 19, 2019
f663440
updated 00
plucodev Sep 20, 2019
9935509
updated 05
plucodev Sep 24, 2019
6521ffa
updated 09
plucodev Sep 24, 2019
40c3e55
updated 10
plucodev Sep 24, 2019
6eec555
updated 11
plucodev Sep 24, 2019
c5b19f3
updated 12
plucodev Sep 24, 2019
14e0788
updated 13
plucodev Sep 25, 2019
ecaaa72
updated 13 and 14
plucodev Sep 25, 2019
6f79798
updated 17
plucodev Sep 25, 2019
ddbbdc8
updated 15
plucodev Sep 26, 2019
544913e
updated 16
plucodev Sep 26, 2019
17448f5
updated 13
plucodev Sep 26, 2019
5d7c381
updated 14
plucodev Sep 26, 2019
c88878a
updated 18
plucodev Sep 26, 2019
790bff9
updated 20
plucodev Sep 26, 2019
7a74ef8
updated 21
plucodev Sep 26, 2019
640bd6f
updated 12
plucodev Sep 26, 2019
4698f63
updated 21
plucodev Sep 26, 2019
5fe14a6
updated 22
plucodev Sep 26, 2019
c7fe498
updated 23
plucodev Sep 26, 2019
0feaf3f
updated 24
plucodev Sep 27, 2019
e4d881c
updated 25
plucodev Sep 27, 2019
69336d0
updated 25
plucodev Sep 27, 2019
79757da
updated 24
plucodev Sep 27, 2019
59eba4b
updated 23
plucodev Sep 27, 2019
8d2d02b
updated 21
plucodev Sep 27, 2019
ee9965f
updated 20
plucodev Sep 27, 2019
3f42207
updated 22
plucodev Sep 30, 2019
6946622
fixed issues 01-02-03-13
plucodev Oct 2, 2019
62db4c9
fixed issues 04
plucodev Oct 2, 2019
8cafcd7
fixed issues 05
plucodev Oct 2, 2019
7da8203
fixed issues 07
plucodev Oct 2, 2019
71d4172
fixed issues 08
plucodev Oct 2, 2019
a9520e7
fixed issues 09
plucodev Oct 2, 2019
5255d84
fixed issues 10
plucodev Oct 2, 2019
211f128
fixed issues 11
plucodev Oct 2, 2019
2e0bc06
fixed issues 12
plucodev Oct 2, 2019
e0d5a2a
fixed issues 12
plucodev Oct 2, 2019
1742933
fixed issues 13
plucodev Oct 2, 2019
ee37430
fixed issues 14-15-16
plucodev Oct 2, 2019
38d4e0e
fixed issues 17-18-19
plucodev Oct 4, 2019
0fb467b
fixed issues 21
plucodev Oct 4, 2019
f51d6be
fixed issues 22
plucodev Oct 4, 2019
f980101
fixed issues 23
plucodev Oct 4, 2019
e29047e
fixed issues 24 - 25
plucodev Oct 5, 2019
537d4e7
fixed issues 01 - 02
plucodev Oct 5, 2019
9dc7c9b
fixed issues 03
plucodev Oct 7, 2019
c9b5dc2
fixed issues 04
plucodev Oct 7, 2019
1fa2128
fixed issues 05
plucodev Oct 7, 2019
187af9f
deleted constant exercise
plucodev Oct 7, 2019
8500ea0
fixed genaral issues
plucodev Oct 7, 2019
98144e7
fixed issues 07-08-09-17-18
plucodev Oct 7, 2019
File filter

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
Next Next commit
fixed issues 21
  • Loading branch information
plucodev committed Oct 4, 2019
commit 0fb467bd505be881e6f2e9ff9a19cde9eeb3b87d
14 changes: 2 additions & 12 deletions exercises/21-Looping-With-FizzBuzz/app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@

# print('\n'.join("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i) for i in range(1,101)))
def fizz_buzz():
# your code here
for i in range(1,101):
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)



fizz_buzz()
34 changes: 17 additions & 17 deletions exercises/21-Looping-With-FizzBuzz/test.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import io
import sys
sys.stdout = buffer = io.StringIO()

from app import fizz_buzz
# from app import my_function
import pytest
import app
import os
import re

@pytest.mark.it('STEP 3. Your code needs to print the correct output on the console')
def test_for_file_output(capsys):
captured = buffer.getvalue()
f = open(os.path.dirname(os.path.abspath(__file__))+'/app.py')
@pytest.mark.it("1. Don't change or remove the existing code")
def test_forExistingCode(capsys):
f = open(os.path.dirname(os.path.abspath(__file__))+ '/app.py')
content = f.readlines()
content = [x.strip() for x in content]
print("@@@@", content)
regex = r"fizz_buzz\(\)"
assert re.match(regex, content[(len(content)-1)])

# @pytest.mark.it('Your function needs to print "Hello Inside Function" on the console')
# def test_for_function_output(capsys):
# my_function()
# captured = capsys.readouterr()
# assert captured.out == "Hello Inside Function\n"
my_code = [s for s in content if "def fizz_buzz():" in s]
my_codeVar = content.index(my_code[0])
regex = r"def fizz_buzz\(\):"
my_codeCall = [s for s in content[3:] if "fizz_buzz()" in s]
my_codeCallVar = content.index(my_codeCall[0])
regexCall = r"fizz_buzz\(\)"

# @pytest.mark.it('Your function needs to return True')
# def test_for_function_return(capsys):
# assert my_function() == True
assert re.match(regex, content[my_codeVar])
assert re.match(regexCall, content[my_codeCallVar])
@pytest.mark.it('2. Your function needs to print the correct output')
def test_for_function_output(capsys):
fizz_buzz()
captured = capsys.readouterr()
assert captured.out == "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz\n"