CMU Unit 2 Questions With Complete Solutions
Rules for function names - ️️Names must start with letters, but then can include letters or numbers. Can not use reserved words Can not have spaces Given the function shown, which would be a legal call for the code? def drawBigCircle(centerX, centerY, color): Circle(centerX, centerY, 200, 5, fill=color) - ️️drawBigCircle(200, 200, 'red') def drawPrettyStar(numberOfPoints, radius, color): Star(200, 200, radius, numberOfPoints, fill=color) What are the parameters of the function drawPrettyStar? - ️️numberofPoints, radius, color def drawShapes(centerX, centerY, radius, points, color): Star(centerX, centerY, radius, points, fill=color) Star(centerX, centerY, 40, 10, fill=color) drawShapes(300, 200, 'purple', 'blue') drawShapes(100, 200, 'red', 'black') How many shapes are drawn according to the code above? - ️️4
Información del documento
- Subido en
- 6 de marzo de 2024
- Número de páginas
- 2
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas