<jupyter_start><jupyter_text>Bubble Sort<jupyter_code>def sort(lst):
    while True:
        corrected = False
        for i in range(0,len(lst)-1):
            if lst[i]>lst[i+1]:
                lst[i],lst[i+1] = lst[i+1],lst[i]
                corrected = True
        if not corrected:
            return lst
        
sort([2,13,3,7,1,5])
sort([15,14,19,13,20,4,9])<jupyter_output><empty_output><jupyter_text>Selection sort<jupyter_code>def selection_sort(lst):
    for i in range(len(lst)-1):
        min_position = i
        for j in range(i,len(lst)):
            if lst[j]<lst[min_position]:
                min_position = j
        temp = lst[i]
        lst[i]=lst[min_position]
        lst[min_position] = temp
        
        print(lst)


selection_sort([5,3,8,6,7,2])<jupyter_output>[2, 3, 8, 6, 7, 5]
[2, 3, 8, 6, 7, 5]
[2, 3, 5, 6, 7, 8]
[2, 3, 5, 6, 7, 8]
[2, 3, 5, 6, 7, 8]<jupyter_text>Write a Python program to find the index of an item in a specified list.<jupyter_code>lst = [10,30,4,-6]


num = int(input("Enter a element to find index: "))

if num in lst:
    print("index of number is: ",lst.index(num))
else:
    print("number Not in list")<jupyter_output>Enter a element to find index: 33
number Not in list<jupyter_text>Write a Python program to remove a key from a dictionary<jupyter_code>myDict = {'a':1,'b':2,'c':3,'d':4}
print(myDict)
if 'a' in myDict: 
    del myDict['a']
print(myDict)<jupyter_output>{'a': 1, 'b': 2, 'c': 3, 'd': 4}
{'b': 2, 'c': 3, 'd': 4}<jupyter_text>Write a Python program to get the key, value and item in a dictionary.<jupyter_code>dict_num = {1: 10, 2: 20, 3: 30, 4: 40, 5: 50, 6: 60}
print("key  value  count")
for count, (key, value) in enumerate(dict_num.items(), 1):
    print(key,'   ',value,'    ', count)<jupyter_output>key  value  count
1     10      1
2     20      2
3     30      3
4     40      4
5     50      5
6     60      6<jupyter_text>Write a Python program to concatenate all elements in a list into a string and return it.<jupyter_code>def concatenate_list_data(list):
    result= ''
    for element in list:
        result += str(element)
    return result

print(concatenate_list_data([1, 5, 12, 2]))<jupyter_output>15122<jupyter_text>Write a Python program to create all possible strings by using 'a', 'e', 'i', 'o', 'u'. Use the characters exactly once.<jupyter_code>import random
char_list = ['a','e','i','o','u']
random.shuffle(char_list)
print(''.join(char_list))<jupyter_output>ouaei<jupyter_text>Write a Python program to reverse the digits of a given number and add it to the original, If the sum is not a palindrome repeat this procedure.<jupyter_code>def rev_number(n):
  s = 0
  while True:
    k = str(n)
    if k == k[::-1]:
      break
    else:
      m = int(k[::-1])
      n += m
      s += 1
  return n 

print(rev_number(1234))
print(rev_number(1473))<jupyter_output>5555
9339<jupyter_text>Write a Python program to iteration over sets. And also add multiple elemntss<jupyter_code>num_set = set([0, 1, 2, 3, 4, 5])

for x in num_set:
  print(x)


color_set = num_set
color_set.add(3)
print(color_set)
#Add multiple items
color_set.update([3,57,77])
print(color_set)<jupyter_output>{0, 1, 2, 3, 4, 5}
{0, 1, 2, 3, 4, 5, 77, 57}
{'fraction_non_alphanumeric': 0.14635658914728683, 'fraction_numerical': 0.056124031007751936, 'mean_word_length': 3.3535762483130904, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '11278', 'license': 'MIT', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1245, 'n_words': 362, 'path': 'Assignment Dated 13-12-19.ipynb', 'repo_name': 'bharathkuppala309/Assignment', 'size': '3225'}