asked 36.4k views
2 votes
Consider the following line of code: price= input(Please enter the price: ") What would be the next line in your code that will allow you to store the price as a decimal number price price(decimal) price float(price) price decimal(price) price int(price

asked
User Jportway
by
8.1k points

1 Answer

0 votes

Answer:

price float(price)

Step-by-step explanation:

There are four basic type of data type use in the programming to declare the

variable.

1. int: it is used for integer values.

2. float: it is used for decimal values.

3. char: it is used for character values

4. Boolean: it is used for true or false.

in the question, the one option contain the data type float (price float(price)). So, it store the value in decimal.

price int(price): it store the value in integer.

price decimal(price): it is wrong declaration of variable. their is no data type in the programming which name is decimal.

price price(decimal): it is wrong declaration of variable. their is no data type in the programming which name is price.

answered
User Gir
by
8.2k points

No related questions found