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)

DH
Answered by Daniel H. Python tutor

2171 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Write a basic program to output the lowest of 3 input numbers. (You may omit error checks on your inputs)


How could I write a program to convert Km/h to m/s in python


Why are negative indexes used?


How can you take a list of numbers and add 3 to every number in the list using only one line of code?


We're here to help

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

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences