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

2200 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Write a recursive function to find the factorial of a number n.


Which function is ran when an object is instantiated?


How would you get a piece of code to print the numbers 1 to 10


Explain how python programs are structured and give an example of how methods are initiated


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences