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

2187 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

What is the difference between using range() and a list of values?


Write a function that takes an imput (call it usr_in), the user's age (usr_age) and the user's name (usr_nm) and outputs the following string: "Hi, My name is [usr_nm], I am [usr_age] years old, and my favorite number is [usr_in]"


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


Implement a fibonacci function which calculates the nth number of the fibonacci sequence.


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