Chapter 2: Problem 18
You need the user of a program to enter the amount of sales for the week. Write a statement that prompts the user to enter this data and assigns the input to a variable.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 2: Problem 18
You need the user of a program to enter the amount of sales for the week. Write a statement that prompts the user to enter this data and assigns the input to a variable.
All the tools & learning materials you need for study success - in one app.
Get started for free
You need the user of a program to enter a customer's last name. Write a statement that prompts the user to enter this data and assigns the input to a variable.
What is a variable?
Look at the following assignment statements: value1 = 99 value2 = 45.9 value3 = 7.0 value4 = 7 value5 = 'abc' After these statements execute, what is the Python data type of the values referenced by each variable?
Is the variable name sales the same as sales? Why or why not?
What will be displayed by the following program? my_value = 99 my_value = 0 print(my_value)
What do you think about this solution?
We value your feedback to improve our textbook solutions.