PYTHON1.)Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Write a statement that prints the value of price in the form "X dollars and Y cents" on a line by itself. So, if the value of price was 4321, your code would print "43 dollars and 21 cents". If the value was 501 it would print "5 dollars and 1 cents". If the value was 99 your code would print "0 dollars and 99 cents".2.)Write a statement that reads a floating point value from standard input into temperature.3.)Write a statement that reads a word from standard input into firstWord.

Respuesta :

Answer:

#part 1

#read the amount

amount=int(input("enter the amount:"))

#find the dollars

doll=int(amount/100)

// find the cents

cent=amount%100

#print output

print("{} dollars and {} cents.".format(doll,cent))

#part 2

#read a floating point

temperature=float(input("enter the temperature:"))

#part 3

#read a word

firstWord=input("enter a word:")

Explanation:

In part 1, read amount and the find the dollars with the help of "/" operator. Then find the cents with "%" operator and print both.In part 2, read a point and cast it to float then assign it to variable "temperature".In part 3,Read a word and assign it to variable "firstWord".

Output:

enter the amount:4321

43 dollars and 21 cents.

enter the temperature:12.5

enter a word:hello

ACCESS MORE