From 8b9c6371386c0205ef85690fce60b35835ad8727 Mon Sep 17 00:00:00 2001 From: Ritesh Date: Sat, 27 Oct 2018 15:01:16 +0530 Subject: [PATCH 1/2] atm machine and ascii pro Signed-off-by: Ritesh --- SOLUTIONS/asciipro.py | 6 ++++++ SOLUTIONS/atm_machine.py | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 SOLUTIONS/asciipro.py create mode 100644 SOLUTIONS/atm_machine.py diff --git a/SOLUTIONS/asciipro.py b/SOLUTIONS/asciipro.py new file mode 100644 index 00000000..4b81c80d --- /dev/null +++ b/SOLUTIONS/asciipro.py @@ -0,0 +1,6 @@ +#code written by rk301999 +n=input() +pro=1 +for i in n: + pro*=ord(i) +print("given ascii of %s is = %d"%(n,pro)) diff --git a/SOLUTIONS/atm_machine.py b/SOLUTIONS/atm_machine.py new file mode 100644 index 00000000..2e875ed8 --- /dev/null +++ b/SOLUTIONS/atm_machine.py @@ -0,0 +1,14 @@ +n=int(input()) +for i in range(0,n): + k,n=map(int,input().split()) + l=list(map(int,input().split())) + l1=[] + for j in l: + p=n-j + if(p>=0): + l1.append("1") + n=p + else: + l1.append("0") + print("".join(l1)) + From 2aeca4c82a240ce0f2985574b9ba17b90f0025aa Mon Sep 17 00:00:00 2001 From: Ritesh Date: Sat, 27 Oct 2018 16:12:40 +0530 Subject: [PATCH 2/2] binary_3 Signed-off-by: Ritesh --- SOLUTIONS/binary_3.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 SOLUTIONS/binary_3.py diff --git a/SOLUTIONS/binary_3.py b/SOLUTIONS/binary_3.py new file mode 100644 index 00000000..2e875ed8 --- /dev/null +++ b/SOLUTIONS/binary_3.py @@ -0,0 +1,14 @@ +n=int(input()) +for i in range(0,n): + k,n=map(int,input().split()) + l=list(map(int,input().split())) + l1=[] + for j in l: + p=n-j + if(p>=0): + l1.append("1") + n=p + else: + l1.append("0") + print("".join(l1)) +