Starting Out with Python, Student Value Edition (4th Edition)
4th Edition
ISBN: 9780134444468
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 2.10, Problem 42CP
Program Plan Intro
Turtle:
Turtle graphics is a method that is used to simulate a “turtle” to draw a simple graphics based on the given commands.
- • It provides numerous functions that use decision structures, which determines the state of the turtle and performs actions according to the conditions.
Import turtle:
A turtle is a predefined module in a
- • To import the turtle module, use “import turtle” in the program.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Question: How can i incoperate user directional modifications to my code below please, that is, have the user move the images from their keyboard themselves .
import pygame
pygame.init()
screenSize = width,height = 240,180display = pygame.display.set_mode(screenSize)
starImage = pygame.image.load("star.gif")
starBox = starImage.get_rect()
# add a second starstarImage2 = pygame.image.load("star.gif")
starBox2 = starImage2.get_rect()
keepPlaying = True
speed = [10,5]
speed2 = [5,10]
while keepPlaying:
for event in pygame.event.get():
if event.type == pygame.QUIT:
keepPlaying = False
# redraw the background
black = 0,0,0 display.fill(black)
# draw the stars on the screen
starBox = starBox.move(speed)
starBox2 = starBox2.move(speed2)
# update their speed, changing direction if needed
if starBox.left < 0 or starBox.right > width:
speed[0] = - speed[0]if starBox.top < 0 or starBox.bottom > height:
speed[1] = -…
Which of the following Visual Basic constants advances the insertion point to the next line?
a. Advance
b. ControlChars.Advance
c. ControlChars.NewLine
d. none of the above
What are the three options available in Insert >> Picture menuSelect one:a. Clipart, From File, Shapesb. Clipart, Pictures, Shapesc. Clipart, From Files, AutoShapesd. Clipart, Pictures, AutoShapes
Chapter 2 Solutions
Starting Out with Python, Student Value Edition (4th Edition)
Ch. 2.1 - Who is a programmers customer?Ch. 2.1 - What is a software requirement?Ch. 2.1 - What is an algorithm?Ch. 2.1 - What is pseudocode?Ch. 2.1 - Prob. 5CPCh. 2.1 - Prob. 6CPCh. 2.3 - Write a statement that displays your name.Ch. 2.3 - Write a statement that displays the following...Ch. 2.3 - Write a statement that displays the following...Ch. 2.5 - Prob. 10CP
Ch. 2.5 - Which of the following are illegal variable names...Ch. 2.5 - Prob. 12CPCh. 2.5 - Is the following assignment statement valid or...Ch. 2.5 - Prob. 14CPCh. 2.5 - Look at the following assignment statements:...Ch. 2.5 - What will be displayed by the following program?...Ch. 2.6 - You need the user of a program to enter a...Ch. 2.6 - Prob. 18CPCh. 2.7 - Prob. 19CPCh. 2.7 - Prob. 20CPCh. 2.7 - Prob. 21CPCh. 2.8 - How do you suppress the print functions ending...Ch. 2.8 - How can you change the character that is...Ch. 2.8 - Prob. 24CPCh. 2.8 - Prob. 25CPCh. 2.8 - What does the statement print (format (65.4321,...Ch. 2.8 - What does the statement print (format (987654.129,...Ch. 2.9 - What are three advantages of using named...Ch. 2.9 - Write a Python statement that defines a named...Ch. 2.10 - Prob. 30CPCh. 2.10 - Prob. 31CPCh. 2.10 - Prob. 32CPCh. 2.10 - Prob. 33CPCh. 2.10 - Prob. 34CPCh. 2.10 - Prob. 35CPCh. 2.10 - Prob. 36CPCh. 2.10 - Prob. 37CPCh. 2.10 - Prob. 38CPCh. 2.10 - Prob. 39CPCh. 2.10 - Prob. 40CPCh. 2.10 - Prob. 41CPCh. 2.10 - Prob. 42CPCh. 2.10 - Prob. 43CPCh. 2.10 - Prob. 44CPCh. 2.10 - Prob. 45CPCh. 2 - A ______ error does not prevent the program from...Ch. 2 - Prob. 2MCCh. 2 - A(n) __________ is a set of well-defined logical...Ch. 2 - An Informal language that has no syntax rules and...Ch. 2 - A _______ is a diagram that graphically depicts...Ch. 2 - A ______ is a sequence of characters. a. char...Ch. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - A string literal in Python must be enclosed in...Ch. 2 - Prob. 10MCCh. 2 - A(n) __________ makes a variable reference a value...Ch. 2 - This symbol marks the beginning of a comment in...Ch. 2 - Which of the following statements will cause an...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - This operator performs integer division. a. // b....Ch. 2 - This is an operator that raises a number to a...Ch. 2 - This operator performs division, but instead of...Ch. 2 - Prob. 18MCCh. 2 - Which built-in function can be used to read input...Ch. 2 - Prob. 20MCCh. 2 - A magic number is _______. a. a number that is...Ch. 2 - A _______ is a name that represents a value that...Ch. 2 - Programmers must be careful not to make syntax...Ch. 2 - In a math expression, multiplication and division...Ch. 2 - Variable names can have spaces in them.Ch. 2 - In Python, the first character of a variable name...Ch. 2 - If you print a variable that has not been assigned...Ch. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - If a math expression adds a float to an int, what...Ch. 2 - What is the difference between floating-point...Ch. 2 - What is a magic number? Why are magic numbers...Ch. 2 - Assume a program uses the named constant PI to...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Write a Python statement that assigns the sum of...Ch. 2 - Write a Python statement that subtracts the...Ch. 2 - Write a Python statement that multiplies the...Ch. 2 - Prob. 8AWCh. 2 - What would the following display? num = 99 num = 5...Ch. 2 - Assume the variable sales references a float...Ch. 2 - Assume the following statement has been executed:...Ch. 2 - What will the following statement display?...Ch. 2 - Write a turtle graphics statement that draws a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Personal Information Write a program that displays...Ch. 2 - Sales Prediction A company has determined that its...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Distance Traveled Assuming there are no accidents...Ch. 2 - Sales Tax Write a program that will ask the user...Ch. 2 - Miles-per-Gallon A car's miles-per-gallon (MPG)...Ch. 2 - Tip, Tax, and Total Write a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Write...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Transaction Program Last month, Joe...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...Ch. 2 - Turtle Graphics Drawings Use the turtle graphics...
Knowledge Booster
Similar questions
- The moveVertical and slowMoveVertical commands are good places to start. Use moveHorizontal to move the circle 70 pixels to the left.arrow_forwardFlutter: How do I change the Icon image with the other one when I click on it? For instance: I have this code: child: IconButton( icon: Image.asset('assets/images/baguette.png'), iconSize: 150, onPressed: () { openDialog(); }, )) Then the open Dialogue function opens a widget box in a smaller window that has many other icons you can select from? the widget buttons are also implemented IconButton. I want to click on one of the icons in the widget (different dart file) and replace the main Icon that we clicked to open this dialogue to that specific Icon image! I don't know how to go about it. I will appreciate the help.arrow_forwardPlease Help! Create an Android Project named StoryProject, that plays a word game with mobile user.Add more widgets to layout resource defining UI activity. Add seven EditText widget, oneTextView, and one Button to allow mobile user to enter the following:name, age, name of the city, name of the college, profession, type of animal, pet’s nameAfter the mobile user has entered these items, the program should display the following storyinto TextView, inserting the user’s input into the appropriate locations upon clicking onButton widget labelled “Display Story” as shown hereafter in Figure: Story: There once was a person named NAME who lived in CITY. At the age ofAGE, NAME went to college at COLLEGE. NAME graduated and went to workas a PROFESSION. Then, NAME adopted a (n) ANIMAL named PETNAME.They both lived happily ever after!Implement the corresponding process in the overriding method onCreate().arrow_forward
- The Demo page should have similar items grouped together. The controls and input fields should all do something. Entry fields and Password fields should print to a text box and/or a set of labels. Slider controls should show the values selected. A slider could set the level of a progress bar. etc. Half the elements need to be included: Buttons Buttons with graphics Buttons with images Labels Labels with graphics Labels with images TextField PasswordField TextArea as both entry and output. Scroll Bars on the TextArea two or more separate sets of RadioButtons two or more separate sets of CheckBoxes ComboBox ListView Sliders MenuBar (not in the text book, here is an example: https://www.geeksforgeeks.org/javafx-menubar-and-menu/ (Links to an external site.)) Tabs Spinners Colors Drop shadowsarrow_forwardPlease create a short Pac-Man game using gui. Do not use the one on the internet as I am a beginner. Please add a button to start, and a button where user can exit. Please also had and instructions manual into the code where the user can learn how to play the gamearrow_forwardWhich of the following BoxLayout types will place components side by side? A X_AXIS. B Y_AXIS. C HORIZONTAL. D SIDE_BY_SIDE.arrow_forward
- Q.No.1 Write down a simple android application that implements four (4) VIEWs of your own choice i.e, EditText, RadioButton, Button etc. Write down the code and also display output. Take down the screenshot and paste down along with source code.arrow_forwardYou should start by mastering the moveVertical and slowMoveVertical techniques. Learn how to use the moveHorizontal command to move the circle 70 pixels to the left.arrow_forwardPlease written by computer source Provide a solution for 26.9. The solution requires nesting panels (i.e., JPanel w/ GridLayout for buttons; JFrame w/ BorderLayout for the JPanel and JLabel). The following describes the suggested layout managers and placement of the controls. -Create a JPanel -Set JPanel layout manager to GridLayout, add the buttons to this panel -Add the JPanel to the center of the JFrame (i.e., JFrame use BorderLayout) -Add a JLabel control to the "North" of the JFrame Note: Do not implement event-handling for this assignment.arrow_forward
- Find errors in the following statement, and explain how to correct them -i. Button = Jbutton(“Done”);ii) Jalbel 1b, Jbutton;iii) txtFied = new JtextField(20, “Text”);iv. Jpanel panel = new jPanel();arrow_forwardNeed help with this. Add the e.preventDefault() command to prevent the browser from responding to the submit event. Create the following variables containing regular expressions: Create the regex1 variable containing a regular expression literal with a character class that matches any uppercase letter A through Z. Create the regex2 variable containing a regular expression literal that matches any single digit. Create the regex3 variable containing a regular expression with a character class containing the symbols !$#%. (Hint: you will have to use \$ for the $ symbol.) Create an if else statement that with the following conditions and outcomes: a. If the length of pwd is less than 8, set the text content of the feedback object to “Your password must be at least 8 characters.” b. Else if the test() method with the regex1 regular expression applied to…arrow_forwardWhich of the following is not a style to display an element as a flexbox? display: -chrome-flex; display: -webkit-flex; display: -webkit-box display: -ms-flexbox;arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning