Question

In python, create a series of 14 white bars separated by black regions. Each bar should...

In python, create a series of 14 white bars separated by black regions. Each bar should be 11 pixels wide and 230 pixels high. The separation between the bars should be 19 pixels.

Homework Answers

Answer #1

Code:

import tkinter as tk
# --- constants --- (UPPER_CASE_NAMES)
WHITEWIDTH = 11
# --- main --- (lower_case_names)
root = tk.Tk()
root.geometry("439x230")
canvas = tk.Canvas(root)
canvas.config(width=439, height=230,background='black')
canvas.pack()
for i in range(14):
x1 = 19*(i+1)+11*i
y1 = 0
x2 = x1 + WHITEWIDTH
y2 = y1 + 230
canvas.create_rectangle((x1, y1, x2, y2), fill='white')
root.mainloop()

Hope this helps.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
) Code 39 is a common bar code system that consists of narrow and wide bars...
) Code 39 is a common bar code system that consists of narrow and wide bars (black) separated by either wide or narrow spaces (white). Each character contains nine elements (five bars and four spaces). The code for a character starts and ends with a bar (either narrow or wide) and a (white) space appears between each bar. The original specification (since revised) used exactly two wide bars and one wide space in each character. For example, if b and...
Python A text file (WorldSeriesWinners.txt ) contains a chronological list of the World Series winning teams...
Python A text file (WorldSeriesWinners.txt ) contains a chronological list of the World Series winning teams from 1903 through 2009. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. Note the World Series was not played in 1904 and 1994. Write a program to open the file WorldSeriesWinners.txt, read it line by line and store the team names in...
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...
Program Behavior Each time your program is run, it will prompt the user to enter the...
Program Behavior Each time your program is run, it will prompt the user to enter the name of an input file to analyze. It will then read and analyze the contents of the input file, then print the results. Here is a sample run of the program. User input is shown in red. Let's analyze some text! Enter file name: sample.txt Number of lines: 21 Number of words: 184 Number of long words: 49 Number of sentences: 14 Number of...
Findings  In a cohort of 2215 adults with COVID-19 who were admitted to intensive care units at...
Findings  In a cohort of 2215 adults with COVID-19 who were admitted to intensive care units at 65 sites, 784 (35.4%) died within 28 days, with wide variation among hospitals. Factors associated with death included older age, male sex, morbid obesity, coronary artery disease, cancer, acute organ dysfunction, and admission to a hospital with fewer intensive care unit beds. Meaning  This study identified demographic, clinical, and hospital-level factors associated with death in critically ill patients with COVID-19 that may be used to...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
Gender Bias in the Executive Suite Worldwide The Grant Thornton International Business Report (IBR) has described...
Gender Bias in the Executive Suite Worldwide The Grant Thornton International Business Report (IBR) has described itself as "a quarterly survey of business leaders from across the globe … surveying 11,500 businesses in 40 economies across the globe on an annual basis." 1 According to the 2011 IBR, the Asia Pacific region had a higher percentage (27 percent) of female chief executive officers (CEOs) than Europe and North America. Japan is the only Asia Pacific region exception. The report further...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
During the trial, lawyers for the accused said that the men believed that the accounting decisions...
During the trial, lawyers for the accused said that the men believed that the accounting decisions they made were appropriate at the time, and that the accounting treatment was approved by Nortel’s auditors from Deloitte & Touche. Judge Marrocco accepted these arguments. Marrocco added he was “not satisfied beyond a reasonable doubt” that the trio (i.e., Dunn, Beatty, and Gollogly) had “deliberately misrepresented” financial results. Given the facts of the case, do you believe Judge Marrocco’s decision was justified? Explain....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT