Download presentation
Presentation is loading. Please wait.
1
Functions as everyday items
2
def donation_box(coin):
Do you get anything back (directly)? No. So this is a void function.
3
def recycling_bin(paper, plastic, other):
Do you get anything back (directly)? No. So this is a void function.
4
def gumball_machine(coin):
Do you get anything back (directly)? Yes, candy! So this is a value-returning function.
5
def traffic_light(): Clearly you don’t pass anything to the traffic light, so no arguments and hence no parameters, but do you get something from “using” the traffic light? Yes, a traffic signal. So this is a value-returning function.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.