CMPT 120 Lecture 21: Part 1: Functions
26 views2 pages
28 Aug 2018
School
Department
Course
Professor
meghan78 and 39786 others unlocked
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.