From a353bd5614efea6dec889c02636acf5d4fb1f300 Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:10:24 +0000 Subject: [PATCH 1/6] openeditors setting --- .vscode/settings.json | 3 +-- Ex_Files/02_01_begin/main.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 23698105..a29a39eb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,11 +13,10 @@ "editor.tabSize": 2, "editor.useTabStops": true, "emmet.triggerExpansionOnTab": true, - "explorer.openEditors.visible": 0, + "explorer.openEditors.visible": 1, "files.autoSave": "afterDelay", "screencastMode.onlyKeyboardShortcuts": true, "terminal.integrated.fontSize": 18, - "workbench.activityBar.visible": true, "workbench.colorTheme": "Visual Studio Dark", "workbench.fontAliasing": "antialiased", "workbench.statusBar.visible": true diff --git a/Ex_Files/02_01_begin/main.py b/Ex_Files/02_01_begin/main.py index de27c558..28d3b54d 100644 --- a/Ex_Files/02_01_begin/main.py +++ b/Ex_Files/02_01_begin/main.py @@ -1,4 +1,4 @@ -RUN_INDENTED = False +RUN_INDENTED = True message = "running unindented" @@ -11,3 +11,5 @@ def my_function(): greet = "Hello" return greet + +print(my_function()) \ No newline at end of file From e311a197f8f372319389ae7dd3b9016a59d78cf0 Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:17:30 +0000 Subject: [PATCH 2/6] renaming a file --- Ex_Files/01_01_begin/hello.py | 1 + Ex_Files/01_01_begin/local.txt | 0 2 files changed, 1 insertion(+) create mode 100644 Ex_Files/01_01_begin/hello.py delete mode 100644 Ex_Files/01_01_begin/local.txt diff --git a/Ex_Files/01_01_begin/hello.py b/Ex_Files/01_01_begin/hello.py new file mode 100644 index 00000000..9839e63b --- /dev/null +++ b/Ex_Files/01_01_begin/hello.py @@ -0,0 +1 @@ +import this \ No newline at end of file diff --git a/Ex_Files/01_01_begin/local.txt b/Ex_Files/01_01_begin/local.txt deleted file mode 100644 index e69de29b..00000000 From 7ed92c05d3ee84d5d0b80d974603abbc1ea42607 Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:23:07 +0000 Subject: [PATCH 3/6] strings formates --- Ex_Files/02_02_begin/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Ex_Files/02_02_begin/main.py b/Ex_Files/02_02_begin/main.py index 85a3ff30..3ecc7276 100644 --- a/Ex_Files/02_02_begin/main.py +++ b/Ex_Files/02_02_begin/main.py @@ -10,3 +10,7 @@ formatted = greet_format.format(name) print(intrupution, formatted) + +print(formatted.upper()) +print(formatted.lower()) +print(formatted.replace("John", "Mubashir")) \ No newline at end of file From 972d4d581c5dee422ca1045b6a37e7082572a2fa Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:38:23 +0000 Subject: [PATCH 4/6] enumarte in loop --- Ex_Files/02_04_begin/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ex_Files/02_04_begin/main.py b/Ex_Files/02_04_begin/main.py index 6b7b54c6..93d40de1 100644 --- a/Ex_Files/02_04_begin/main.py +++ b/Ex_Files/02_04_begin/main.py @@ -19,3 +19,5 @@ print(i) # enumerate +for i, name in enumerate(NAMES): + print(f"{i}, {name}") \ No newline at end of file From e3a1f245d2d217cc0dd23b77027c5ec0b25eaa62 Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 12:48:51 +0000 Subject: [PATCH 5/6] if else --- Ex_Files/02_05_begin/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ex_Files/02_05_begin/main.py b/Ex_Files/02_05_begin/main.py index 2256e801..0b4744f2 100644 --- a/Ex_Files/02_05_begin/main.py +++ b/Ex_Files/02_05_begin/main.py @@ -6,7 +6,7 @@ CODE_SPACE = "code_space" LOCAL = "local" -current_env = os.environ.get("ENV_NAME", DEVELOPMENT) +current_env = os.environ.get("ENV_NAME", LOCAL) if current_env == DEVELOPMENT: print("Development environment") From a063463e6c71b9605efe5aa40c36668d10b4a776 Mon Sep 17 00:00:00 2001 From: Mubashir Ul Hassan <104030879+Mubashir-Ul-Hassan@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:46:46 +0000 Subject: [PATCH 6/6] challenge --- Ex_Files/03_04/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ex_Files/03_04/main.py b/Ex_Files/03_04/main.py index 5ec888d8..806b72ee 100644 --- a/Ex_Files/03_04/main.py +++ b/Ex_Files/03_04/main.py @@ -29,6 +29,9 @@ laureates_beginning_with_a = [] # LinkedIn learner code here +for laurate in laureates: + if laurate ["name"][0] == "A": + laureates_beginning_with_a.append(laurate) with open("laureates.json", "w") as f: json.dump(laureates_beginning_with_a, f, indent=2)