Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2.5, Problem 11CP
Which of the following are illegal variable names in Python, and why?
x
99bottles
july2009
theSalesFigureForFiscalYear
r&d
grade_report
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule06:12
Students have asked these similar questions
Which of the ff Python statements allows a code to add an external library of functions?
A. dBdt = k1*Ca - k2*Cb
B. t=np.linspace(0,5,100)
C. C0 = [Ca0,Cb0,Cc0]
D. import numpy as np
thanks
Q1)
Which of the following options will return the last letter of the string "Carleton"?
Try to answer this question from your understanding and not typing the expression into the Python interactive mode.
Question 1 options:
my_string = "Carleton"
last = len(my_string) - 1
print(last)
my_string = "Carleton"
last = len(my_string)
print( my_string[last] )
my_string = "Carleton"
size = len(my_string)
last = my_string[size]
print(last)
my_string = "Carleton"
size = len(my_string)
last = my_string[size -1]
print(last)
Which of the following declarations does not follow the Java conventions?
Select 4 correct answer(s)
a)
double costValue;
b)
double costvalue;
c)
public class Areacalculator{
d)
int FirstGrade;
e)
public class AreaCalculatorFinder{
f)
String MyFirstName;
Chapter 2 Solutions
Starting Out with Python (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...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
The following C++ program will not compile because the lines have been mixed up. int main() } //A crazy mixed u...
Starting Out with C++: Early Objects (9th Edition)
Practice Problem 3.17 (solution page 331) An alternate rule for translating if statements into goto code is as ...
Computer Systems: A Programmer's Perspective (3rd Edition)
(Average speed in kilometers) Assume that a runner runs 24 miles in 1 hour, 40 minutes, and 35 seconds. Write a...
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
(Separating the Digits in an Integer) Write an application that inputs one number consisting of five digits fro...
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Which of the following would be an appropriate variable name using the Python naming convention? A 3rd place B Third place C thirdPlace D thirdplacearrow_forward6- Which of the following options most accurately reflects a key purpose of objects? a. To group related Python keywords. b. To group related pieces of data. c. To group related script files. d. To group related comments.arrow_forwardConisder the Python string s = ”university”.What is Python output for the following commands? 1) s.index(’i’)2) s[-1]arrow_forward
- QUESTION 17 Which one of the following is not a keyword in Python language? A. eval B. assert C. nonlocal D. passarrow_forwardWhich of the following variable names follows the good practice guidelines outlined in the Python Style Guide (PP8)? A priceperitem B price_per_item C price per item D Price_Per_Itemarrow_forwardWhich of the following is not a legal identifier?a) spam b) spAm c) 2spam d) spam4Uarrow_forward
- Which of the following software is used for making resume? Select one: a. Java b. MS Excel c. MS Word d. DUSISarrow_forwardwhich of the ff Python statement assigns a variable to a list of values? A. dBdt = k1*Ca - k2*Cb B. t=np.linspace(0,5,100) C. C0 = [Ca0,Cb0,Cc0] D. import numpy as np thanksarrow_forwardYou Need to Find the Location of Procedure forWhich You Only Know Part of the NameThe Problem: You "sort of " know the name of the procedure you want tofind? This is a common problem for Microsoft Windows programmers because ofthe extremely inconsistent naming convention of the procedures in the WindowsAPI. UNIX programmers fare no better. Only the inconsistency in namingconversions is consistent; the only problem is that UNIX likes to leave letters outof system call names (for example, creat).arrow_forward
- please help me to answer the following question use ibm as 400 1 - develop a new Library called BCIBnnLIB (nn is your student login id number). What command did you use? 2 - develop a new Jobq BCIBnnJQ1 and Outq BCIBnnOQ in the Library BCIBnnLIB. What commands did you use? 3 - Grant the USER=MCAMPBELL AUT=*USE Object Authority to your BCIBnnLIB library. Hint 4 - develop a new Source File in your new library to contain your CL source. What command did you use? 5 - Execute the program named ASSIGN1CPY in library BCI433N1A. This program does the following: Puts 1 member in your CL source file. develop a file QDDSSRC in your library with 1 member. develop a Display File in your library 5 - continued a) What is the name of the 1 member in your CL source file? b) What is the name of the member in your DDS source file? c) What is the name of the Display file in your library? 6 - Look at the CL source member. a) Copy the member and rename it ASSIGN1. b) You are to rearrange this source code to…arrow_forwardWhich of the following is user data that is collected automatically? A) user address B) credit card number C) date of birth D) cookie I’darrow_forwardwhich of the following statements correctly describe the results of executing the highlighted command below $id uid= 108(mr) gid=10(prog) $ls -larrow_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 Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License