From e1141699dc75d39e77973b642198d9fca8f45f1e Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 12 Sep 2022 18:11:10 +0200 Subject: [PATCH 01/23] =?UTF-8?q?Els=C5=91=20commit=20c=C3=ADme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 012bd27..e20d8bd 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# 5-Python-Projects-For-Beginners \ No newline at end of file +# 5-Python-Projects-For-Beginners + +Első commit tartalma \ No newline at end of file From 2366a2f3d9bfdadd287677b6959c4daac001b9f1 Mon Sep 17 00:00:00 2001 From: Agicka Date: Mon, 12 Sep 2022 19:00:30 +0200 Subject: [PATCH 02/23] =?UTF-8?q?Saj=C3=A1t=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e20d8bd..1f8614c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # 5-Python-Projects-For-Beginners -Első commit tartalma \ No newline at end of file +Első commit tartalma + +Saját commit \ No newline at end of file From 72b60ed9915c092442089dd0c3b049546350b9b5 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 12 Sep 2022 19:23:10 +0200 Subject: [PATCH 03/23] =?UTF-8?q?M=C3=A1sodik=20commit=20c=C3=ADme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e20d8bd..da3e237 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # 5-Python-Projects-For-Beginners -Első commit tartalma \ No newline at end of file +Első commit tartalma, és a második commit tartalma \ No newline at end of file From 2593c9c8a920d97ee5a3150c1743e497eafe9da5 Mon Sep 17 00:00:00 2001 From: LMNikoletta Date: Mon, 12 Sep 2022 19:24:52 +0200 Subject: [PATCH 04/23] =?UTF-8?q?M=C3=A1sodik=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e20d8bd..e0fbb37 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # 5-Python-Projects-For-Beginners -Első commit tartalma \ No newline at end of file +Első commit tartalma +Második commit \ No newline at end of file From 0a487b279804ef0a50a682b39449af5619c0e7dc Mon Sep 17 00:00:00 2001 From: Agicka Date: Mon, 12 Sep 2022 19:31:54 +0200 Subject: [PATCH 05/23] =?UTF-8?q?Saj=C3=A1t=20commit=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f8614c..9de7649 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Első commit tartalma -Saját commit \ No newline at end of file +Saját commit 2 \ No newline at end of file From 55ffef935e4aa993c0a4f228797fefaeff10b3bc Mon Sep 17 00:00:00 2001 From: Albert Date: Sat, 17 Sep 2022 10:26:48 +0200 Subject: [PATCH 06/23] =?UTF-8?q?calculate=20f=C3=BCggv=C3=A9ny=20hozz?= =?UTF-8?q?=C3=A1adva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monthly_payment_calculator.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 monthly_payment_calculator.py diff --git a/monthly_payment_calculator.py b/monthly_payment_calculator.py new file mode 100644 index 0000000..ea18446 --- /dev/null +++ b/monthly_payment_calculator.py @@ -0,0 +1,6 @@ +# calculate monthly payment +def calculate(p: int, months: int, rate: float): + return (rate/12) * (1/(1-(1+rate/12)**(-months)))*p + + + From a2ad6a27cbb91043b0de1aa71bab1fda79d6e354 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 12 Sep 2022 20:25:51 +0200 Subject: [PATCH 07/23] =?UTF-8?q?F=C3=BCggv=C3=A9nyes=C3=ADt=C3=A9s=20els?= =?UTF-8?q?=C5=91=20k=C3=B6r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index 3249fe4..0dabebd 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -18,18 +18,28 @@ computer_pick = options[random_number] print("Computer picked", computer_pick + ".") - if user_input == "rock" and computer_pick == "scissors": - print("You won!") - user_wins += 1 + def rps_match(user_input_param): - elif user_input == "paper" and computer_pick == "rock": - print("You won!") - user_wins += 1 + if user_input_param == "rock" and computer_pick == "scissors": + print("You won!") + return "user_wins" + + elif user_input_param == "paper" and computer_pick == "rock": + print("You won!") + return "user_wins" - elif user_input == "scissors" and computer_pick == "paper": + elif user_input_param == "scissors" and computer_pick == "paper": + print("You won!") + return "user_wins" + + else: + print("You lost!") + return "computer_wins" + + + if rps_match(user_input) == "user_wins": print("You won!") user_wins += 1 - else: print("You lost!") computer_wins += 1 From 03c0008be35243484cf7de0f1a197fe14dce52db Mon Sep 17 00:00:00 2001 From: ajonas Date: Tue, 13 Sep 2022 14:19:47 +0200 Subject: [PATCH 08/23] =?UTF-8?q?Els=C5=91=20teszt=20-=20t=C3=BAl=20er?= =?UTF-8?q?=C5=91sen=20van=20be=C3=A1gyazva=20a=20f=C3=BCggv=C3=A9ny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_rock_paper_scissors.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test_rock_paper_scissors.py diff --git a/test_rock_paper_scissors.py b/test_rock_paper_scissors.py new file mode 100644 index 0000000..eebcad1 --- /dev/null +++ b/test_rock_paper_scissors.py @@ -0,0 +1,8 @@ +import rock_paper_scissors +from rock_paper_scissors import rps_match + + +def test_rps_match(): + computer_pick = "rock" + assert rock_paper_scissors.rps_match("paper") == "You won!" + From ec6e9a80d2be63e5feb8349231fcff3c5f85e7ed Mon Sep 17 00:00:00 2001 From: ajonas Date: Tue, 13 Sep 2022 14:21:34 +0200 Subject: [PATCH 09/23] =?UTF-8?q?Els=C5=91=20=C3=A1talak=C3=ADt=C3=A1s=20-?= =?UTF-8?q?=20f=C3=BCggv=C3=A9nyt=20kompaktt=C3=A1=20tessz=C3=BCk,=20de=20?= =?UTF-8?q?m=C3=A9g=20az=20eredeti=20modulban?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index 0dabebd..79ccac0 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -13,13 +13,13 @@ if user_input not in options: continue - random_number = random.randint(0, 2) - # rock: 0, paper: 1, scissors: 2 - computer_pick = options[random_number] - print("Computer picked", computer_pick + ".") - def rps_match(user_input_param): + random_number = random.randint(0, 2) + # rock: 0, paper: 1, scissors: 2 + computer_pick = options[random_number] + print("Computer picked", computer_pick + ".") + if user_input_param == "rock" and computer_pick == "scissors": print("You won!") return "user_wins" From 732cfe367b803b917f450267209c5b7e9da174a1 Mon Sep 17 00:00:00 2001 From: ajonas Date: Tue, 13 Sep 2022 14:24:12 +0200 Subject: [PATCH 10/23] =?UTF-8?q?M=C3=A1sodik=20=C3=A1talak=C3=ADt=C3=A1s?= =?UTF-8?q?=20-=20saj=C3=A1t=20modulba=20helyezz=C3=BCk=20a=20f=C3=BCggv?= =?UTF-8?q?=C3=A9nyt=20(de=20van=20benne=20egy=20hiba)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 26 +------------------------- rps_match.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 rps_match.py diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index 79ccac0..f9a461d 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -1,4 +1,4 @@ -import random +import rps_match user_wins = 0 computer_wins = 0 @@ -13,30 +13,6 @@ if user_input not in options: continue - def rps_match(user_input_param): - - random_number = random.randint(0, 2) - # rock: 0, paper: 1, scissors: 2 - computer_pick = options[random_number] - print("Computer picked", computer_pick + ".") - - if user_input_param == "rock" and computer_pick == "scissors": - print("You won!") - return "user_wins" - - elif user_input_param == "paper" and computer_pick == "rock": - print("You won!") - return "user_wins" - - elif user_input_param == "scissors" and computer_pick == "paper": - print("You won!") - return "user_wins" - - else: - print("You lost!") - return "computer_wins" - - if rps_match(user_input) == "user_wins": print("You won!") user_wins += 1 diff --git a/rps_match.py b/rps_match.py new file mode 100644 index 0000000..9a0e2ba --- /dev/null +++ b/rps_match.py @@ -0,0 +1,25 @@ +import random + + +def rps_match(user_input_param): + + random_number = random.randint(0, 2) + # rock: 0, paper: 1, scissors: 2 + computer_pick = options[random_number] + print("Computer picked", computer_pick + ".") + + if user_input_param == "rock" and computer_pick == "scissors": + print("You won!") + return "user_wins" + + elif user_input_param == "paper" and computer_pick == "rock": + print("You won!") + return "user_wins" + + elif user_input_param == "scissors" and computer_pick == "paper": + print("You won!") + return "user_wins" + + else: + print("You lost!") + return "computer_wins" \ No newline at end of file From 9ba5ce543a23e6d23ece976abbbf3b6b50a3463e Mon Sep 17 00:00:00 2001 From: ajonas Date: Tue, 13 Sep 2022 14:28:40 +0200 Subject: [PATCH 11/23] =?UTF-8?q?Harmadik=20=C3=A1talak=C3=ADt=C3=A1s=20-?= =?UTF-8?q?=20Hib=C3=A1k=20jav=C3=ADt=C3=A1sa=20(keress=C3=A9tek=20meg=20?= =?UTF-8?q?=C5=91ket!)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 5 ++--- rps_match.py | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index f9a461d..26d8146 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -1,10 +1,9 @@ import rps_match +from rps_match import options user_wins = 0 computer_wins = 0 -options = ["rock", "paper", "scissors"] - while True: user_input = input("Type Rock/Paper/Scissors or Q to quit: ").lower() if user_input == "q": @@ -13,7 +12,7 @@ if user_input not in options: continue - if rps_match(user_input) == "user_wins": + if rps_match.rps_match(user_input) == "user_wins": print("You won!") user_wins += 1 else: diff --git a/rps_match.py b/rps_match.py index 9a0e2ba..3f291f7 100644 --- a/rps_match.py +++ b/rps_match.py @@ -1,25 +1,23 @@ import random +options = ["rock", "paper", "scissors"] + def rps_match(user_input_param): - + random_number = random.randint(0, 2) # rock: 0, paper: 1, scissors: 2 computer_pick = options[random_number] print("Computer picked", computer_pick + ".") if user_input_param == "rock" and computer_pick == "scissors": - print("You won!") return "user_wins" elif user_input_param == "paper" and computer_pick == "rock": - print("You won!") return "user_wins" elif user_input_param == "scissors" and computer_pick == "paper": - print("You won!") return "user_wins" else: - print("You lost!") - return "computer_wins" \ No newline at end of file + return "computer_wins" From fcf5cf8b75dfc6e208ce959078caace753b8d271 Mon Sep 17 00:00:00 2001 From: ajonas Date: Tue, 13 Sep 2022 14:31:38 +0200 Subject: [PATCH 12/23] =?UTF-8?q?Teszt=20=C3=A1talak=C3=ADt=C3=A1s=20-=20B?= =?UTF-8?q?ukik=20a=20teszt,=20jav=C3=ADtjuk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_rock_paper_scissors.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test_rock_paper_scissors.py b/test_rock_paper_scissors.py index eebcad1..f176468 100644 --- a/test_rock_paper_scissors.py +++ b/test_rock_paper_scissors.py @@ -1,8 +1,7 @@ -import rock_paper_scissors -from rock_paper_scissors import rps_match +import rps_match def test_rps_match(): computer_pick = "rock" - assert rock_paper_scissors.rps_match("paper") == "You won!" + assert rps_match.rps_match("paper") == "You won!" From acc08245108462a84db2631f51356185ef57091d Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 14 Sep 2022 18:58:13 +0200 Subject: [PATCH 13/23] =?UTF-8?q?Mocking=20hozz=C3=A1adva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_rock_paper_scissors.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test_rock_paper_scissors.py b/test_rock_paper_scissors.py index f176468..f31a38e 100644 --- a/test_rock_paper_scissors.py +++ b/test_rock_paper_scissors.py @@ -1,7 +1,11 @@ import rps_match +import random +from unittest.mock import MagicMock + +random.randint = MagicMock(return_value=0) -def test_rps_match(): - computer_pick = "rock" - assert rps_match.rps_match("paper") == "You won!" +def test_rps_match(): + # computer_pick = "rock" + assert rps_match.rps_match("paper") == "user_wins" From 1971f642db9ef59bcf701c73123e1f9c8a245fce Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 14 Sep 2022 19:44:42 +0200 Subject: [PATCH 14/23] =?UTF-8?q?Hozz=C3=A1adva=208=20m=C3=A1sik=20teszt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_rock_paper_scissors.py | 47 +++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/test_rock_paper_scissors.py b/test_rock_paper_scissors.py index f31a38e..42e38f4 100644 --- a/test_rock_paper_scissors.py +++ b/test_rock_paper_scissors.py @@ -3,9 +3,48 @@ from unittest.mock import MagicMock -random.randint = MagicMock(return_value=0) - -def test_rps_match(): - # computer_pick = "rock" +def test_rps_match_paper_rock(): + random.randint = MagicMock(return_value=0) assert rps_match.rps_match("paper") == "user_wins" + + +def test_rps_match_paper_paper(): + random.randint = MagicMock(return_value=1) + assert rps_match.rps_match("paper") == "computer_wins" + + +def test_rps_match_paper_scissors(): + random.randint = MagicMock(return_value=2) + assert rps_match.rps_match("paper") == "computer_wins" + + +def test_rps_match_scissors_rock(): + random.randint = MagicMock(return_value=0) + assert rps_match.rps_match("scissors") == "computer_wins" + + +def test_rps_match_scissors_paper(): + random.randint = MagicMock(return_value=1) + assert rps_match.rps_match("scissors") == "user_wins" + + +def test_rps_match_scissors_scissors(): + random.randint = MagicMock(return_value=2) + assert rps_match.rps_match("scissors") == "computer_wins" + + +def test_rps_match_rock_rock(): + random.randint = MagicMock(return_value=0) + assert rps_match.rps_match("rock") == "computer_wins" + + +def test_rps_match_rock_paper(): + random.randint = MagicMock(return_value=1) + assert rps_match.rps_match("rock") == "computer_wins" + + +def test_rps_match_rock_scissors(): + random.randint = MagicMock(return_value=2) + assert rps_match.rps_match("rock") == "user_wins" + From 62d47f9efb140c3fb72bdee5cb097d5b2019a92e Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 14 Sep 2022 19:51:20 +0200 Subject: [PATCH 15/23] =?UTF-8?q?Hibajav=C3=ADt=C3=A1s:=20d=C3=B6ntetlen?= =?UTF-8?q?=20eset=20kezelve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 6 +++++- rps_match.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index 26d8146..f1deef7 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -15,9 +15,13 @@ if rps_match.rps_match(user_input) == "user_wins": print("You won!") user_wins += 1 - else: + + elif rps_match.rps_match(user_input) == "computer_wins": print("You lost!") computer_wins += 1 + else: + print("Nobody wins!") + print("You won", user_wins, "times.") print("The computer won", computer_wins, "times.") diff --git a/rps_match.py b/rps_match.py index 3f291f7..5e3d5cb 100644 --- a/rps_match.py +++ b/rps_match.py @@ -18,6 +18,7 @@ def rps_match(user_input_param): elif user_input_param == "scissors" and computer_pick == "paper": return "user_wins" - + elif user_input_param == computer_pick: + return "nobody wins" else: return "computer_wins" From a2229edc7b294c038ac7d976a4ca23f455ebf8ec Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 14 Sep 2022 20:15:24 +0200 Subject: [PATCH 16/23] =?UTF-8?q?Hibajav=C3=ADt=C3=A1s:=20duplik=C3=A1lt?= =?UTF-8?q?=20h=C3=ADv=C3=A1s=20jav=C3=ADtva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rock_paper_scissors.py | 6 ++++-- test_rock_paper_scissors.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index f1deef7..7d25d87 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -12,11 +12,13 @@ if user_input not in options: continue - if rps_match.rps_match(user_input) == "user_wins": + result = rps_match.rps_match(user_input) + + if result == "user_wins": print("You won!") user_wins += 1 - elif rps_match.rps_match(user_input) == "computer_wins": + elif result == "computer_wins": print("You lost!") computer_wins += 1 else: diff --git a/test_rock_paper_scissors.py b/test_rock_paper_scissors.py index 42e38f4..ee227c6 100644 --- a/test_rock_paper_scissors.py +++ b/test_rock_paper_scissors.py @@ -11,7 +11,7 @@ def test_rps_match_paper_rock(): def test_rps_match_paper_paper(): random.randint = MagicMock(return_value=1) - assert rps_match.rps_match("paper") == "computer_wins" + assert rps_match.rps_match("paper") == "nobody wins" def test_rps_match_paper_scissors(): @@ -31,12 +31,12 @@ def test_rps_match_scissors_paper(): def test_rps_match_scissors_scissors(): random.randint = MagicMock(return_value=2) - assert rps_match.rps_match("scissors") == "computer_wins" + assert rps_match.rps_match("scissors") == "nobody wins" def test_rps_match_rock_rock(): random.randint = MagicMock(return_value=0) - assert rps_match.rps_match("rock") == "computer_wins" + assert rps_match.rps_match("rock") == "nobody wins" def test_rps_match_rock_paper(): From acb6cc395c31256751e874e0d3f5d4184be6f717 Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 14 Sep 2022 20:24:59 +0200 Subject: [PATCH 17/23] =?UTF-8?q?F=C3=BCggv=C3=A9nyk=C3=A9nt=20kiemelve=20?= =?UTF-8?q?a=20men=C3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.py | 32 ++++++++++++++++++++++++++++++++ rock_paper_scissors.py | 31 ++----------------------------- 2 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 game.py diff --git a/game.py b/game.py new file mode 100644 index 0000000..28390c8 --- /dev/null +++ b/game.py @@ -0,0 +1,32 @@ +import rps_match +from rps_match import options + + +def game(): + user_wins = 0 + computer_wins = 0 + + while True: + user_input = input("Type Rock/Paper/Scissors or Q to quit: ").lower() + if user_input == "q": + break + + if user_input not in options: + continue + + result = rps_match.rps_match(user_input) + + if result == "user_wins": + print("You won!") + user_wins += 1 + + elif result == "computer_wins": + print("You lost!") + computer_wins += 1 + else: + print("Nobody wins!") + + print("You won", user_wins, "times.") + print("The computer won", computer_wins, "times.") + print("Goodbye!") + diff --git a/rock_paper_scissors.py b/rock_paper_scissors.py index 7d25d87..e39ba42 100644 --- a/rock_paper_scissors.py +++ b/rock_paper_scissors.py @@ -1,30 +1,3 @@ -import rps_match -from rps_match import options +import game -user_wins = 0 -computer_wins = 0 - -while True: - user_input = input("Type Rock/Paper/Scissors or Q to quit: ").lower() - if user_input == "q": - break - - if user_input not in options: - continue - - result = rps_match.rps_match(user_input) - - if result == "user_wins": - print("You won!") - user_wins += 1 - - elif result == "computer_wins": - print("You lost!") - computer_wins += 1 - else: - print("Nobody wins!") - - -print("You won", user_wins, "times.") -print("The computer won", computer_wins, "times.") -print("Goodbye!") +game.game() From 16dae906d6811ef216ecdc311e6dae5bae41c912 Mon Sep 17 00:00:00 2001 From: Agicka Date: Mon, 19 Sep 2022 18:23:14 +0200 Subject: [PATCH 18/23] payment test --- test_monthly_payment_calculator.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test_monthly_payment_calculator.py diff --git a/test_monthly_payment_calculator.py b/test_monthly_payment_calculator.py new file mode 100644 index 0000000..ac20e9e --- /dev/null +++ b/test_monthly_payment_calculator.py @@ -0,0 +1,5 @@ +from monthly_payment_calculator import calculate + + +def test_calculate(): + assert round(calculate(1000000, 48, 0.1)) == 25363 From 3ffc8d17d59e81a37ac63ae1534692f3b7286633 Mon Sep 17 00:00:00 2001 From: Agicka Date: Mon, 19 Sep 2022 18:39:54 +0200 Subject: [PATCH 19/23] payment test elnevezve --- test_monthly_payment_calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_monthly_payment_calculator.py b/test_monthly_payment_calculator.py index ac20e9e..d7372fb 100644 --- a/test_monthly_payment_calculator.py +++ b/test_monthly_payment_calculator.py @@ -1,5 +1,5 @@ from monthly_payment_calculator import calculate -def test_calculate(): +def test_calculate_egymillio_negyev_tizszazalek(): assert round(calculate(1000000, 48, 0.1)) == 25363 From 4e3a6ae59030e2abb51d459435f13fe7042b3156 Mon Sep 17 00:00:00 2001 From: Agicka Date: Wed, 21 Sep 2022 19:02:12 +0200 Subject: [PATCH 20/23] =?UTF-8?q?anagram.py=20l=C3=A9trehozva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anagram.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 anagram.py diff --git a/anagram.py b/anagram.py new file mode 100644 index 0000000..1a4ce38 --- /dev/null +++ b/anagram.py @@ -0,0 +1,7 @@ +str1 = input("Enter the First String = ") +str2 = input("Enter the Second String = ") + +if(sorted(str1) == sorted(str2)): + print("Two Strings are Anagrams.") +else: + print("Two Strings are not Anagrams.") \ No newline at end of file From 7a33ee0acc6797f5e72920beb30d5088433fb6e0 Mon Sep 17 00:00:00 2001 From: Agicka Date: Wed, 21 Sep 2022 19:14:29 +0200 Subject: [PATCH 21/23] =?UTF-8?q?anagram=20f=C3=BCggv=C3=A9nyes=C3=ADt?= =?UTF-8?q?=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anagram_fuggveny.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 anagram_fuggveny.py diff --git a/anagram_fuggveny.py b/anagram_fuggveny.py new file mode 100644 index 0000000..37b6e68 --- /dev/null +++ b/anagram_fuggveny.py @@ -0,0 +1,10 @@ +def anagram_fuggveny(str1, str2): + if(sorted(str1) == sorted(str2)): + return "Two Strings are Anagrams." + else: + return "Two Strings are not Anagrams." + +str1 = input("Enter the First String = ") +str2 = input("Enter the Second String = ") +result = anagram_fuggveny(str1, str2) +print(anagram_fuggveny(str1, str2)) \ No newline at end of file From 7375993a1fe6a85f2d6e98f696550fc1a9f7ce2e Mon Sep 17 00:00:00 2001 From: Agicka Date: Thu, 22 Sep 2022 17:59:09 +0200 Subject: [PATCH 22/23] =?UTF-8?q?anagram=20f=C3=BCggv=C3=A9ny=20jav=C3=ADt?= =?UTF-8?q?va?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anagram_fuggveny.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/anagram_fuggveny.py b/anagram_fuggveny.py index 37b6e68..2596fb1 100644 --- a/anagram_fuggveny.py +++ b/anagram_fuggveny.py @@ -1,10 +1,5 @@ -def anagram_fuggveny(str1, str2): +def anagram_fuggveny(): if(sorted(str1) == sorted(str2)): return "Two Strings are Anagrams." else: return "Two Strings are not Anagrams." - -str1 = input("Enter the First String = ") -str2 = input("Enter the Second String = ") -result = anagram_fuggveny(str1, str2) -print(anagram_fuggveny(str1, str2)) \ No newline at end of file From ebff3cf5cc72fc312b3590b93e1cd286b23690e3 Mon Sep 17 00:00:00 2001 From: Agicka Date: Thu, 22 Sep 2022 18:01:32 +0200 Subject: [PATCH 23/23] tesztesetek --- test_anagram_fuggveny.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test_anagram_fuggveny.py diff --git a/test_anagram_fuggveny.py b/test_anagram_fuggveny.py new file mode 100644 index 0000000..345151c --- /dev/null +++ b/test_anagram_fuggveny.py @@ -0,0 +1,11 @@ +def test_anagram_fuggveny(): + str1 = "vér" + str2 = "rév" + assert "Two Strings are Anagrams." + + +def test_anagram_fuggveny(): + str1 = "vér" + str2 = "alma" + assert "Two Strings are not Anagrams." +