Content-Length: 1250 | pFad | http://github.com/codebasics/data-structures-algorithms-python/pull/96.patch
thub.com
From 13096bb424c98f5ad08bebefaf5f469ba67354f7 Mon Sep 17 00:00:00 2001
From: Vedant
Date: Sat, 30 Nov 2024 10:15:56 +0000
Subject: [PATCH] Added the solution
---
.replit | 4 ++++
Solutions/array_solution.py | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 .replit
create mode 100644 Solutions/array_solution.py
diff --git a/.replit b/.replit
new file mode 100644
index 0000000..455af93
--- /dev/null
+++ b/.replit
@@ -0,0 +1,4 @@
+modules = ["python-3.12"]
+
+[nix]
+channel = "stable-24_05"
\ No newline at end of file
diff --git a/Solutions/array_solution.py b/Solutions/array_solution.py
new file mode 100644
index 0000000..be1fc53
--- /dev/null
+++ b/Solutions/array_solution.py
@@ -0,0 +1,37 @@
+# Exercise:
+
+l= [2200,2350,2600,2130,2190] # Given list
+
+# 1 .-->
+
+print(f"The money spent extra is ${l[1]-l[0]}")
+
+# 2.-->
+
+
+a= l[:3]
+b= sum(a)
+
+print(f"The expense is ${b}")
+
+# 3.-->
+
+for expense in l:
+ if expense==2000:
+ print("Yes, You spent exactly $2000 in a moth")
+ break
+
+ else:
+ f= False
+
+if f==False:
+ print("No,You didn't")
+
+# 4.-->
+
+l.append(1980)
+
+# 5.-->
+
+l[2]=1830
+
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/codebasics/data-structures-algorithms-python/pull/96.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy