Your main problem was declaring int prod in the while loop. This caused prod to be reset back to 1 every time the while loop ran.
Answer:
float(distance) / speed
Explanation:
Given the variable <em>distance</em> and <em>speed</em> in a program that hold a integer value respectively. We can perform the division between the two variable using / operator. Since both distance and speed are integers, we need to convert one of them to float type to perform the floating point arithmetic. Otherwise the division output will be rounded up to the nearest integer which is not a desired result.
In 2013, Toyota changed its organizational structure from the centralized structure to:
- the Global hierarchy,
- the Geographic divisions, and
- the Product-based divisions.
This change was made to adapt the consumer's demand in each of the regional markets all over the world. The most important element of this structure is the speed of handling issues and problems of all Toyota's branches. However, this structure also has a weakness which is the decreasing of headquarter's control over the global organization.
def func():
total = 0
while True:
pet = input("What pet do you have? ")
if pet == "rock":
return
total += 1
print("You have a {} with a total of {} pet(s)".format(pet, total))
func()
We wrapped our code in a function so that whenever the user enters rock, we can simply return and exit the function. If you have any other questions, I'll do my best to answer them.