Computer Science, asked by harjas03, 3 months ago

Write a Python program to get the smallest number from a

list​

Answers

Answered by Anonymous
0

Answer:

Given a list of numbers, the task is to write a Python program to find the smallest number in given list. Method 1 : Sort the list in ascending order and print the first element in the list. Method 4: Find the smallest element in list. # Assign first element as a minimum.

Answered by mahitaravi
0

Answer:

Explanation:

def smallest_num_in_list( list ):

   min = list[ 0 ]

   for a in list:

       if a < min:

           min = a

   return min

print(smallest_num_in_list([1, 2, -8, 0]))

I hope it helps

tpwk

Similar questions