There was an error while loading. Please reload this page.
1 parent 4e79b7f commit 14c35c2Copy full SHA for 14c35c2
27th March/check_same_city.py
@@ -0,0 +1,14 @@
1
+def check_same_city(person1, person2):
2
+ if person1['city'] == person2['city']:
3
+ return True
4
+ else:
5
+ return False
6
+
7
+# Example usage
8
+person1 = {'name': 'John', 'city': 'New York'}
9
+person2 = {'name': 'Jane', 'city': 'Los Angeles'}
10
11
+if check_same_city(person1, person2):
12
+ print("Both persons belong to the same city.")
13
+else:
14
+ print("Both persons belong to different cities.")
27th March/sameCity.py
0 commit comments