Presentation is loading. Please wait.

Presentation is loading. Please wait.

Functions as everyday items

Similar presentations


Presentation on theme: "Functions as everyday items"— Presentation transcript:

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.

6


Download ppt "Functions as everyday items"

Similar presentations


Ads by Google