UNIT I IP
UNIT I IP
UNIT I IP
Output:
Enter the list of numbers2,0,-8,1
-8
def insertionSort(arr):
for i in range(1, len(arr)):
key = arr[i]
j = i-1
while j >=0 and key < arr[j] :
arr[j+1] = arr[j]
j -= 1
arr[j+1] = key
Output:
Enter the list of elements4,2,0,-7
Sorted array is:
-7
0
2
4
if guess == hidden:
print "Guessed correctly!"
elif guess < hidden:
print "Your guess is too low"
else:
print "Your guess is too high"
Output:
please enter your guess: 154
Your guess is too high
disks = 3
hanoi(disks, 'A','C','B')
Output: