Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYTHON: Write a series of tkinter statements to draw a face, with a mouth, a nose, and two eyes. Use your eye-drawing code from

IN PYTHON:

Write a series of tkinter statements to draw a face, with a mouth, a nose, and two eyes. Use your eye-drawing code from last week's lab. But don't just copy those lines twice! Even if you use copy and paste to avoid tedious retyping, duplicate code is always a problem: It makes the program longer, and if you have to change it, you have to change every copy. If you skip changing one copy of the duplicate code, your program becomes an inconsistent mess. Happily, we've learned how to avoid writing duplicate code in this situation: We design a function called draw_eye to contain our eye-drawing code; then we call that function twice, once for each eye. But there's one more step, because we don't want to draw both eyes in the same place. Our draw_eye function needs parameters that specifies the starting point for the drawing; then we can call it twice, one with a starting point that's offset from the other.

Write a function called draw_face that calls functions (that you also write) called draw_eye, draw_nose, and draw_mouth. Your nose and mouth don't have to be as fancy as your eyes; in fact, make them as crude and simple as you can to start with, and only refine them if you have time. Include at least two calls to draw_face in your lab3.py file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions