From 0b8408f19893eba8ce264a0e4bbf40914a94d18f Mon Sep 17 00:00:00 2001
From: Amit160701 <44643323+Amit160701@users.noreply.github.com>
Date: Sat, 5 Sep 2020 10:40:18 +0530
Subject: [PATCH 1/5] Update assignment_01.py

---
 Section_04/assignment_01.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Section_04/assignment_01.py b/Section_04/assignment_01.py
index abf45ed..bcbfb9c 100644
--- a/Section_04/assignment_01.py
+++ b/Section_04/assignment_01.py
@@ -12,12 +12,18 @@
 
 """
 
-def twelver(a, b):
-    return (a == 12 or b == 12 or a+b == 12)
-
 
 
 
+def twelver(a,b):
+    if (a==12 or b==12):
+        return True
+    elif (a+b==12):
+        return True
+    else:
+        return False
+    
+twelver(9,3)
 
 
 
@@ -48,4 +54,4 @@ def twelver(a, b):
 
 # Solution:
 # def twelver(a, b):
-#   return (a == 12 or b == 12 or a+b == 12)
\ No newline at end of file
+#   return (a == 12 or b == 12 or a+b == 12)

From 19e397d0a3f656dd92d8ec6b7bcff73837ca4a75 Mon Sep 17 00:00:00 2001
From: Amit160701 <44643323+Amit160701@users.noreply.github.com>
Date: Sat, 5 Sep 2020 10:49:02 +0530
Subject: [PATCH 2/5] Update assignment_02.py

---
 Section_04/assignment_02.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Section_04/assignment_02.py b/Section_04/assignment_02.py
index 10f2464..272428b 100644
--- a/Section_04/assignment_02.py
+++ b/Section_04/assignment_02.py
@@ -18,7 +18,8 @@
 """
 
 def pay_extra(working, hour):
-    return (working and (hour < 8 or hour > 20))
+    return (working and (hour<8 or hour>20))
+pay_extra(True, 7)
 
 
 
@@ -47,4 +48,4 @@ def pay_extra(working, hour):
 
 # Solution
 # def pay_extra(working, hour):
-#     return (working and (hour < 8 or hour > 20))
\ No newline at end of file
+#     return (working and (hour < 8 or hour > 20))

From 2e2e0b817d65580c2cec0bc31e9da2c7cd09c55e Mon Sep 17 00:00:00 2001
From: Amit160701 <44643323+Amit160701@users.noreply.github.com>
Date: Sat, 5 Sep 2020 10:53:42 +0530
Subject: [PATCH 3/5] Update assignment_02.py


From d8c4d9fea89ab0a3da73fda5a1d765223a294089 Mon Sep 17 00:00:00 2001
From: Amit160701 <44643323+Amit160701@users.noreply.github.com>
Date: Sun, 6 Sep 2020 11:10:45 +0530
Subject: [PATCH 4/5] Update assignment_05.py

---
 Section_04/assignment_05.py | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/Section_04/assignment_05.py b/Section_04/assignment_05.py
index 5a6f98d..10d2eba 100644
--- a/Section_04/assignment_05.py
+++ b/Section_04/assignment_05.py
@@ -10,23 +10,14 @@
 first3([1, 2, 6, 3, 4]) → True
 first3([1, 2, 3, 4, 6]) → False
 first3([1, 2, 3, 4, 5]) → False
-
 """
-
-def first3(numbers):
-
-    end = len(numbers)
-
-    if end > 4:
-        end = 4
-
-    for i in range(end): # loop over index 0,1,2,3
-        if numbers[i] == 6:
+def find_num(list):
+    for i in range(0,4):
+        if list[i]==6:
             return True
-
-    # if we get here, the loop is over and we didn't find a 6
     return False
 
+ 
 
 print(first3([1,2,6,3,0,0])) # true
 print(first3([1,2,3,3,0,6])) # false

From 9af75026dfaaca07405c631c6f7b6d2c0ef86542 Mon Sep 17 00:00:00 2001
From: Amit160701 <44643323+Amit160701@users.noreply.github.com>
Date: Sun, 6 Sep 2020 11:47:15 +0530
Subject: [PATCH 5/5] Update assignment_06.py

---
 Section_04/assignment_06.py | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/Section_04/assignment_06.py b/Section_04/assignment_06.py
index 96b31e8..b4b48f2 100644
--- a/Section_04/assignment_06.py
+++ b/Section_04/assignment_06.py
@@ -16,21 +16,14 @@
 
 """
 
-def last2(str):
-
-    if len(str) <= 2:
-        return 0
-
-    # last 2 chars can also be extracted with str[-2:]
-    last2 = str[len(str) - 2:]
-    count = 0
-
-    for i in range(len(str) - 2):
-        sub = str[i : i+2]
-        if sub == last2:
-            count = count + 1
-
-    return count
+def last2(str):    
+    last_2=str[len(str)-2:]
+    counter=0
+    for i in range(len(str)-2):
+        word=str[i:i+2]
+        if word==last_2:
+            counter=counter+1
+    return counter
 
 
 print(last2('hixxhi')) #→ 1
