Assignment1 (01fe17bar039) PDF
Assignment1 (01fe17bar039) PDF
if select == '1':
print (number_1 + number_2)
if n == 0: a = 0
elif n == 1: b = 0
else:
for i in range(2,n):
c = a + b
a = b
b = c
print (b)
OUTPUT-
1
2
3
5
8
13
21
34
num1 = 10
num2 = 14
num3 = 12
if (num1 >= num2) and (num1 >= num3):
largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3
print("The largest number between",num1,",",num2,"and",num3,"is",largest)
OUTPUT- The largest number between 10 , 14 and 12 is 14
lst.sort()
print(lst[0])
OUTPUT-
Smallest element is: 1
print(string2)
OUTPUT- hello-class-hello
for x in range(len(lst)-1):
a = x
for y in range(x,len(lst)):
if lst[y] < lst[a]:
a = y
temp = lst[x]
lst[x] = lst[a]
lst[a] = temp
print(lst)
OUTPUT-
Sorted array-[2, 2, 3, 3, 4, 4, 5, 5, 6, 57, 57]
print(lst)
OUTPUT-
Sorted array is: [2, 2, 3, 3, 4, 4, 5, 5, 6, 57, 57]