CMPT 120 Lecture 21: Part 1: Functions

26 views2 pages
meghan78 and 39786 others unlocked
CMPT 120 Full Course Notes
29
CMPT 120 Full Course Notes
Verified Note
29 documents

Document Summary

Write a python program calc. py that: defines and calls a menu function, the function prints the following lines and do not return any value: #define a menu function def menu(): print( enter a to add numbers: ) print( enter s to subtract numbers: ) Write a python program circ. py that: draws a circle for given diameter(25), the function do not return any value, call the function to circle of diameter 50. #call the circle function import turtle circle(25) circle(50) Write a python program calc. py that: defines and calls an add function, the function adds two given numbers and returns the sum value. #define the add function def add(num1, num2): sum = num1 + num2 return sum. #call the add function result = add(56, 78) Write a python program enroll. py that: defines and calls a name function, the function inputs first name and last name.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions