Question
Answer in Python A seven segment display is used to show numbers, using 7 separate segments which can be lit up individually. They are labeled
Answer in Python
A seven segment display is used to show numbers, using 7 separate segments which can be lit up individually. They are labeled A through G in the image below.
Part A: Write one function that would turn on different segments to represent the digits 0 - 9. This function would take in one parameter, representing the number that we want to display. Assume that turning on a light segment is a boolean. For instance, if I wanted to turn on segment A, I would write something like:
segmentAOn = True
And if I wanted to turn it off, I would write something like:
segmentAOn = False
For example, the code to display the number 8 could look something like this:
segmentAOn = True
segmentBOn = True
segmentCOn = True
segmentDOn = True
segmentEOn = True
segmentFOn = True
segmentGOn = True
Part B: Write function calls that would cause the number 1, then the number 2, then the number 3 to display.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started