All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
starting out with python
Questions and Answers of
Starting Out With Python
Write a turtle graphics statement that draws a circle with a radius of 75 pixels.
What will the following code display?val = 99print('The value is', 'val')
In the expression 12 + 7, the values on the right and left of the + symbol are called __________.a. Operandsb. Operatorsc. Argumentsd. Math expressions
Write the turtle graphics statements to draw a square that is 100 pixels wide on each side and filled with the color blue.
Look at the following assignment statements:value1 = 99value2 = 45.9value3 = 7.0value4 = 7value5 = 'abc'After these statements execute, what is the Python data type of the values referenced by each
This operator performs integer division.a. //b. %c. **d. /
Write the turtle graphics statements to draw a square that is 100 pixels wide on each side and a circle that is centered inside the square. The circle’s radius should be 80 pixels. The circle
Use the turtle graphics library to write programs that reproduce each of the designs shown in Figure 2-34. Figure 2-34 Designs West North +0 East South
What will be displayed by the following program?my_value = 99my_value = 0print(my_value)
This operator performs division, but instead of returning the quotient it returns the remainder.a. %b. *c. **d. /
This is an operator that raises a number to a power.a. %b. *c. **d. /
Suppose the following statement is in a program: price = 99.0. After this statement executes, the price variable will reference a value of which data type?a. Intb. Floatc. Currencyd. Str
What value will be assigned to result after the following statement executes?result = 9 // 2
Which built-in function can be used to read input that has been typed on the keyboard?a. Input()b. Get_input()c. Read_input()d. Keyboard()
What value will be assigned to result after the following statement executes?result = 9 % 2
Which built-in function can be used to convert an int value to a float?a. Int_to_float()b. Float()c. Convert()d. Int()
A magic number is ________________.a. A number that is mathematically undefinedb. An unexplained value that appears in a program’s codec. A number that cannot be divided by 1d. A number that causes
How do you suppress the print function’s ending newline?
A __________ is a name that represents a value that does not change during the program’s execution.a. Named literalb. Named constantc. Variable signatured. Key term
How can you change the character that is automatically displayed between multiple items that are passed to the print function?
What is the '' escape character?
What does the + operator do when it is used with two strings?
To make sure that you can interact with IDLE, try the following steps on your computer:• Start IDLE. To do this in Windows, type IDLE in the Windows search box. Click the IDLE desktop app, which
A(n) __________ is a set of instructions that a computer follows to perform a task.a. Compilerb. Programc. Interpreterd. Programming language
To make sure that you can interact with the Python interpreter, try the following steps on your computer:• Start the Python interpreter in interactive mode.• At the >>> prompt, type the
True or FalseToday, CPUs are huge devices made of electrical and mechanical components such as vacuum tubes and switches.
What is hardware?
What number does a bit that is turned on represent? What number does a bit that is turned off represent?
The physical devices that a computer is made of are referred to as __________.a. Hardwareb. Softwarec. The operating systemd. Tools
True or FalseMain memory is also known as RAM.
The part of a computer that runs programs is called __________.a. RAMb. Secondary storagec. Main memorye. The CPU
A CPU understands instructions that are written only in what language?
Use what you’ve learned about the binary numbering system in this chapter to convert the following decimal numbers to binary:1. 142. 873. 1284. 254
True or FalseAny piece of data that is stored in a computer’s memory must be stored as a binary number.
What do the terms “digital data” and “digital device” mean?
How many different characters can be represented in ASCII? Name the character set that addresses this limitation.
The tiny dots of color that digital images are composed of are called __________.a. Bitsb. Bytesc. Color packetsd. Pixels
Negative numbers are encoded using the __________ technique.a. Two’s complementb. Floating pointc. ASCIId. Unicode
Real numbers are encoded using the __________ technique.a. Two’s complementb. Floating pointc. ASCIId. Unicode
A program has to be copied into what type of memory each time the CPU executes it?
Computers can only execute programs that are written in __________.a. Javab. Assembly languagec. Machine languaged. Python
When a CPU executes the instructions in a program, it is engaged in what process?
The __________ translates an assembly language program to a machine language program.a. Assemblerb. Compilerc. Translatord. Interpreter
In the __________ part of the fetch-decode-execute cycle, the CPU determines which operation it should perform.a. Fetchb. Decodec. Executed. Deconstruct
What is assembly language?
What type of programming language allows you to create powerful and complex programs without knowing how the CPU works?
What do you call a program that translates a high-level language program into a separate machine language program?
Each language has a set of rules that must be strictly followed when writing a program. What is this set of rules called?
What type of mistake is usually caused by a misspelled key word, a missing punctuation character, or the incorrect use of an operator?
The words that make up a high-level programming language are called __________.a. Binary instructionsb. Mnemonicsc. Commandsd. Key words
What do you call a program that both translates and executes the instructions in a high-level language program?
A(n) __________ program translates a high-level language program into a separate machine language program.a. Assemblerb. Compilerc. Translatord. Utility
True or FalseProgrammers must be careful not to make syntax errors when writing pseudocode programs.
Who is a programmer’s customer?
Write Python code that prompts the user to enter his or her age and assigns the user’s input to an integer variable named age.
What is a software requirement?
A __________ error does not prevent the program from running, but causes it to produce incorrect results.a. Syntaxb. Hardwarec. Logicd. Fatal
Write a program that displays the following information:• Your name• Your address, with city, state, and ZIP• Your telephone number• Your college major
What does a professional programmer usually do first to gain an understanding of a problem?
A __________ is a single function that the program must perform in order to satisfy the customer.a. Taskb. Software requirementc. Prerequisited. Predicate
A(n) __________ is a set of well-defined logical steps that must be taken to perform a task.a. Logarithmb. Plan of actionc. Logic scheduled. Algorithm
A company has determined that its annual profit is typically 23 percent of total sales. Write a program that asks the user to enter the projected amount of total sales, then displays the profit that
True or FalseIn a math expression, multiplication and division take place before addition and subtraction.
Write Python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
How does pseudocode differ from actual code written in a programming language?
One pound is equivalent to 0.454 kilograms. Write a program that asks the user to enter the mass of an object in pounds and then calculates and displays the mass of the object in kilograms.
Computer programs typically perform what three steps?
What rules and considerations should influence the names given to variables in a program?
True or FalseVariable names can have spaces in them.
An informal language that has no syntax rules and is not meant to be compiled or executed is called __________.a. Faux codeb. Pseudocodec. Pythond. A flowchart
True or FalseIn Python, the first character of a variable name cannot be a number.
What is pseudocode?
Write a statement that creates a two-dimensional list with three rows and four columns. Each element should be assigned the value 0.
Write a set of nested loops that display the contents of the numbers list shown in Checkpoint question 7.19.Checkpoint 7.19Look at the following interactive session, in which a two-dimensional list
What is the primary difference between a list and a tuple?
Look at the following interactive session, in which a two-dimensional list is created. How many rows and how many columns are in the list?numbers = [[1, 2], [10, 20], [100, 200], [1000, 2000]]
Assume my_list references a list. Write a statement that converts it to a tuple.
To create a graph with the plot function, what two arguments you must pass?
Which of the following statements creates a tuple?a. Values = [1, 2, 3, 4]b. Values = {1, 2, 3, 4}c. Values = (1)d. values = (1,)
Create a text file that contains your expenses for last month in the following categories:• Rent• Gas• Food• Clothing• Car payment• MiscWrite a Python program that reads the data from the
What is the difference between calling a list’s remove method and using the del statement to remove an element?
In the student sample programs for this book, you will find a text file named 1994_Weekly_ Gas_Averages.txt. The file contains the average gas price for each week in the year 1994. (There are 52
How do you find the lowest and highest values in a list?
Assume the following statement appears in a program:names = [ ]Which of the following statements would you use to add the string ‘Wendy’ to the list at index 0? Why would you select this
Describe the following list methods:a. Indexb. Insertc. Sortd. Reverse
Give two reasons why tuples exist.
Assume my_tuple references a tuple. Write a statement that converts it to a list.
What sort of graph does the plot function produce?
What functions do you use to add labels to the X and Y axes in a graph?
How do you change the lower and upper limits of the X and Y axes in a graph?
How do you customize the tick marks along the X and Y axes in a graph?
To create a bar chart with the bar function, what two arguments you must pass?
Assume the following statement calls the bar function to construct a bar chart with four bars. What color will the bars be?plt.bar(left_edges, heights, color=('r', 'b', 'r', 'b'))
To create a pie chart with the pie function, what argument you must pass?
Write a program that gets strings containing a person’s first and last name as separate values, and then displays their “initials”, “name in address book”, and “username”. For example,
Assume the variable name references a string. Write a for loop that prints each character in the string.
This is the first index in a string.a. −1b. 1c. 0d. The size of the string minus one
True or FalseOnce a string is created, it cannot be changed.
What does the following code display?mystr = 'abc'mystr2 = '123'mystr += mystr2print(mystr)
Write a program that asks the user to enter a series of single-digit numbers with nothing separating them. The program should display the sum of all the single digit numbers in the string. For
Showing 500 - 600
of 839
1
2
3
4
5
6
7
8
9