Skip to content

Commit b824952

Browse files
committed
After Course section7
1 parent e1fe18a commit b824952

File tree

12 files changed

+15
-10
lines changed

12 files changed

+15
-10
lines changed

Section7/.idea/Section7.iml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section7/.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Section7/lecture71/sub/Program3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Program to show import
22

33
from lecture71 import Mymodule
4-
print(Mymodule.my_fun())
4+
Mymodule.my_fun()
55
print(Mymodule.my_var)
66

File renamed without changes.

Section7/lecture72/Program3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Program to rename a file using os module
22

33
from os import rename
4-
os.rename("File2.txt", "File1.txt")
4+
rename("File1.txt", "File2.txt")
55
print("File renamed")

Section7/lecture73/Program1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Program to show use of try except block
1+
12# Program to show use of try except block
22

33
try:
44
n = int(input("Enter a number \n"))

Section7/lecture73/Program3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
if d == 0:
66
raise Exception("Denominator is zero")
77
else:
8-
print("division = ",(n/d))
8+
print("division = ", (n/d))
99

Section7/lecture73/Program5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Program to show Assertions in python
22

33
def print_age(age):
4-
assert(age>0),"Age must be greater than zero"
5-
print("Age = ",age)
4+
assert(age > 0), "Age must be greater than zero"
5+
print("Age = ", age)
66

77

88
print_age(20)

Section7/lecture74/Program3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Program to show regular expressions in Python
22

33
import re
4-
str1 = ":david:"
4+
str1 = ":david:,:paul:"
55
pattern = r":(\w+):+"
66
find = re.findall(pattern, str1)
77
if find:

Section7/lecture77/Program1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def fun1():
1111
def fun3(fun):
1212
fun()
1313

14+
1415
fun3(fun2)
1516

1617

Section7/lecture77/Program2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Program to show decorators in Python
22

33
def dec_func(original_func):
4+
45
def wrap_func():
56
print("before call");
67
original_func();
78
print("After call");
9+
810
return wrap_func;
911

1012

0 commit comments

Comments
 (0)