From 06b12bac85db63d44e543a4a50d5576273d26d48 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Mon, 14 Oct 2024 11:18:20 +0530 Subject: [PATCH] Made minor changes in pass 1 code and moved it to it's own folder since it also has a source file. --- Codes/{pass 1.py => Group A/Assignment-A1/Code-A1.py} | 11 +++++------ .../Assignment-A1/source.txt} | 0 2 files changed, 5 insertions(+), 6 deletions(-) rename Codes/{pass 1.py => Group A/Assignment-A1/Code-A1.py} (94%) rename Codes/{source (pass1).txt => Group A/Assignment-A1/source.txt} (100%) diff --git a/Codes/pass 1.py b/Codes/Group A/Assignment-A1/Code-A1.py similarity index 94% rename from Codes/pass 1.py rename to Codes/Group A/Assignment-A1/Code-A1.py index a788e25..2681c95 100755 --- a/Codes/pass 1.py +++ b/Codes/Group A/Assignment-A1/Code-A1.py @@ -1,11 +1,12 @@ -#Original Code, Engineered by Afan Shaikh. no AI. +# Assignment-A1 + try: source = open('source.txt','r') data = source.read() - print('File read successfully bro \n\n') + print('File read successfully\n\n') source.seek(0) except FileNotFoundError: #A little bit of exception handling - print('\n\n\nFile Not found. Create a source.txt first! u dummy!\n\n\n ') + print('\n\n\nFile Not found. Create a source.txt first.\n\n\n ') except IOError: print('There was an IO error') LT_index = 0 #index of LT table @@ -42,8 +43,6 @@ def handle_start(): print("No Start Statement! Abort!\n") return 0 - - def pass1(): add=handle_start() if not add: @@ -107,4 +106,4 @@ def intermediate(): print(entry) pass1() -intermediate() \ No newline at end of file +intermediate() diff --git a/Codes/source (pass1).txt b/Codes/Group A/Assignment-A1/source.txt similarity index 100% rename from Codes/source (pass1).txt rename to Codes/Group A/Assignment-A1/source.txt