diff --git a/exc.py b/exc.py new file mode 100644 index 0000000..9d1b261 --- /dev/null +++ b/exc.py @@ -0,0 +1,7 @@ +try: + f = open("testFile",mode = "r") + f.write("writing a line here") +except: + print("hey you have an error") +finally: + print("you tried to write in a read only file!!") \ No newline at end of file diff --git a/new.py b/new.py new file mode 100644 index 0000000..221d0c6 --- /dev/null +++ b/new.py @@ -0,0 +1,6 @@ +ar=input() +ar=ar.split(" ") +c=0 +for n in range(len(ar)): + c = c + int(ar[n]) +print(c) \ No newline at end of file