From 7fd83cda6065dcfa86b4a7135da5b7cc88c1db65 Mon Sep 17 00:00:00 2001 From: Eduardo Cardenas Date: Fri, 16 Dec 2022 05:08:29 -0600 Subject: [PATCH 1/2] solution for punched-cards in python --- solutions/punched-cards/punchedCards.py | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 solutions/punched-cards/punchedCards.py diff --git a/solutions/punched-cards/punchedCards.py b/solutions/punched-cards/punchedCards.py new file mode 100644 index 00000000..8a71fd6a --- /dev/null +++ b/solutions/punched-cards/punchedCards.py @@ -0,0 +1,28 @@ +def punchCard(R, C): + + for r in range(R * 2 + 1): + for c in range(C * 2 + 1): + if r < 2 and c < 2: + print(".", end="") + else: + if r % 2 == 0: + if c % 2 == 0: + print("+", end="") + else: + print("-", end="") + else: + if c % 2 == 0: + print("|", end="") + else: + print(".", end="") + print("") + + +# Read the number of test cases. +T = int(input()) +# Loop over the number of test cases. +for test_no in range(1, T + 1): + # get rows and columns + (R, C) = tuple(map(int, input().split())) + print("Case #%d:" % test_no) + punchCard(R, C) From 82ac3343e665b7938b51c32c29f330ee86dad979 Mon Sep 17 00:00:00 2001 From: David Cardenas <52186152+davidcardd1@users.noreply.github.com> Date: Fri, 23 Dec 2022 16:54:08 -0600 Subject: [PATCH 2/2] Rename punchedCards.py to punched_cards.py --- solutions/punched-cards/{punchedCards.py => punched_cards.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename solutions/punched-cards/{punchedCards.py => punched_cards.py} (100%) diff --git a/solutions/punched-cards/punchedCards.py b/solutions/punched-cards/punched_cards.py similarity index 100% rename from solutions/punched-cards/punchedCards.py rename to solutions/punched-cards/punched_cards.py