Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Задача 2
- # Напишете функция, която намира минимума в списък от цели числа. Списъкът се подава като параметър.
- # Резултатът се връща от функцията.
- def min_num_of_list (list_num):
- split_list = list_num.split(",")
- min_num = int(split_list[0])
- for element in range(1, len(split_list)):
- if min_num > int(split_list[element]):
- min_num = int(split_list[element])
- return min_num
- num_list = input("Please enter list of integer: ")
- print(f"The smallest number specified in the list is: {min_num_of_list(num_list)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement