Professional Documents
Culture Documents
python pgms
python pgms
lst = []
ele = int(input())
lst.append(ele)
lst.sort()
print(lst)
print("".join([str1, str2]))
5. PYTHON program to find the largest and smallest numbers from the given ‘n numbers
lst = []
for n in range(num):
lst.append(numbers)
print("Maximum element in the list is :", max(lst), "\nMinimum element in the list is :",
min(lst))
num = 7
factorial = 1
elif num == 0:
else:
factorial = factorial*i
Write a PYTHON program to print the sum of current number and previous number
previous_num = 0
# loop from 1 to 10
x_sum = previous_num + i
print("Current Number", i, "Previous Number ", previous_num, " Sum: ", previous_num +
i)
previous_num = i
Write a PYTHON program to print characters from a string that are present at
an even index number