From 2b3236759dc3892001d2098faf7a9641681a501f Mon Sep 17 00:00:00 2001 From: JANHVI SINGH <103685692+Janhvisingh21@users.noreply.github.com> Date: Tue, 4 Oct 2022 10:40:17 +0530 Subject: [PATCH 1/3] Sumoftwonumbers.py --- Code/Sumoftwonumbers.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Code/Sumoftwonumbers.py diff --git a/Code/Sumoftwonumbers.py b/Code/Sumoftwonumbers.py new file mode 100644 index 0000000..c447367 --- /dev/null +++ b/Code/Sumoftwonumbers.py @@ -0,0 +1,9 @@ +#python program to add two numbers +x = input("Enter a number: ") +y = input("Enter another number: ") + +sum = int(x) + int(y) + +print("The sum is: ", sum) +Footer +© 2022 GitHub, Inc. From 04b439752a43d8ea997bcad988bb60b544aefee2 Mon Sep 17 00:00:00 2001 From: JANHVI SINGH Date: Tue, 8 Nov 2022 12:32:59 +0530 Subject: [PATCH 2/3] Create Bubblesort.py --- Code/Bubblesort.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Code/Bubblesort.py diff --git a/Code/Bubblesort.py b/Code/Bubblesort.py new file mode 100644 index 0000000..083cc89 --- /dev/null +++ b/Code/Bubblesort.py @@ -0,0 +1,7 @@ +list=eval(input("Enter list of elements:")) +n=len(list) +for i in range(n): + for j in range(0,n-i-1): + if list[j]>list[j+1]: + list[j],list[j+1]=list[j+1],list[j] + print("List after sorting:",list) From 2c8deab5a65e93f1ccafc6e137302ccff17d5964 Mon Sep 17 00:00:00 2001 From: JANHVI SINGH Date: Tue, 8 Nov 2022 12:41:35 +0530 Subject: [PATCH 3/3] Create linearsearch.py --- linearsearch.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 linearsearch.py diff --git a/linearsearch.py b/linearsearch.py new file mode 100644 index 0000000..7a08538 --- /dev/null +++ b/linearsearch.py @@ -0,0 +1,8 @@ +list=[6,9,19,34,21,43,89] +n=int(input('enter a number')) +for i in range(len(list)): + if list[i]==n: + print('found at pos',i+1) + break +else: + print('not found')