Manually implement a function that finds the smallest value in a list of integers and print it.

def findMin(list): min = list[0] for i in range(1, len(list)): if list[i] < min: min = list[i] print(min)

Answered by Daniel H. Python tutor

2096 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

How would you loop over every key and value in a python dictionary?


Explain how you would write a python program that takes a rectangle and a point in a 2D space as command-line arguments and checks if they intersect.


How do I define a function in Python?


Write a function that checks whether a number is prime or not.


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo
Cookie Preferences