WGU Python OA
Task:
Create an answer that accepts an integer enter representing water temperature in levels
Fahrenheit. Output a description of the water country based on the following scale:
If the temperature is underneath 33° F, the water is "Frozen".
If the water is among 33° F and 80° F (including 33°), the water is "Cold".
If the water is among eighty° F and one hundred fifteen° F (along with 80°), the water is "Warm".
If the water is between 115° F and 211° F (together with 115°) , the water is "Hot".
If the water is greater than or same to 212° F, the water is "Boiling".
Additionally, output a protection remark most effective during the following circumstances:
If the water is precisely 212° F, the protection remark is, "Caution: Hot!"
If the water temperature is much less than 33° F, the protection remark is, "Watch out for ice!"
print("Enter the water temperature:")
temperature = int(input())
if temperature >= 212:
state="Boiling"
elif a hundred and fifteen <= temperature <= 211:
kingdom="Hot"
elif 80 <= temperature < a hundred and fifteen:
state="Warm"
elif 33 <= temperature < 80:
state="Cold"
else:
state="Frozen"
print(state)
if temperature >= 212:
print("Caution: Hot!")
elif temperature < 33:
print("Watch out for ice!")
Create a solution that accepts an integer input identifying what number of one of a kind shares
of stock are purchased from the Old Town Stock Exchange, followed through an equivalent wide
variety of string inputs representing the inventory alternatives.
The following dictionary, stock, lists to be had stock selections as the key and the fee per
selection as the price.
Stocks = 'TSLA': 912.86 , 'BBBY': 24.Eighty four, 'AAPL': 174.26, 'SOFI': 6.Ninety two, 'KIRK':
8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33
, Output the entire value of the purchased stocks of stock to two decimal locations.
The answer output must be inside the layout:
Total charge: $cost_of_stocks
shares = 'TSLA': 912.86, 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92, 'KIRK': 8.Seventy two,
'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33
total = 0
print("Enter a amount of shares observed by stock symbol(s):")
num_items = int(enter())
for i in range(num_items):
item = enter()
if item in shares.Keys():
overall += stocks[item]
print(f'Total price: $general:.2f')
Create a solution that accepts a string input representing a grocery save object and an integer
input identifying the quantity of objects purchased on a recent visit. The following dictionary
purchase lists to be had items as the important thing and the cost in line with item because the
fee.
Buy = "bananas": 1.85, "steak": 19.Ninety nine, "cookies": 4.Fifty two, "celery": 2.81, "milk":
four.34
Additionally,
If fewer than 10 gadgets are purchased, the fee is the entire value in step with object.
If between 10 and 20 objects (inclusive) are purchased, the purchase gets a 5% discount.
If 21 or extra items are purchased, the purchase gets a ten% bargain.
Output the selected item and the overall buy price to 2 decimal locations.
The answer output should be in the layout:
amount item_purchased general price: $total_purchase_cost
buy = "bananas": 1.Eighty five, "steak": 19.Ninety nine, "cookies": four.52, "celery": 2.Eighty one,
"milk": four.34
print("Enter the object to buy:")
Task:
Create an answer that accepts an integer enter representing water temperature in levels
Fahrenheit. Output a description of the water country based on the following scale:
If the temperature is underneath 33° F, the water is "Frozen".
If the water is among 33° F and 80° F (including 33°), the water is "Cold".
If the water is among eighty° F and one hundred fifteen° F (along with 80°), the water is "Warm".
If the water is between 115° F and 211° F (together with 115°) , the water is "Hot".
If the water is greater than or same to 212° F, the water is "Boiling".
Additionally, output a protection remark most effective during the following circumstances:
If the water is precisely 212° F, the protection remark is, "Caution: Hot!"
If the water temperature is much less than 33° F, the protection remark is, "Watch out for ice!"
print("Enter the water temperature:")
temperature = int(input())
if temperature >= 212:
state="Boiling"
elif a hundred and fifteen <= temperature <= 211:
kingdom="Hot"
elif 80 <= temperature < a hundred and fifteen:
state="Warm"
elif 33 <= temperature < 80:
state="Cold"
else:
state="Frozen"
print(state)
if temperature >= 212:
print("Caution: Hot!")
elif temperature < 33:
print("Watch out for ice!")
Create a solution that accepts an integer input identifying what number of one of a kind shares
of stock are purchased from the Old Town Stock Exchange, followed through an equivalent wide
variety of string inputs representing the inventory alternatives.
The following dictionary, stock, lists to be had stock selections as the key and the fee per
selection as the price.
Stocks = 'TSLA': 912.86 , 'BBBY': 24.Eighty four, 'AAPL': 174.26, 'SOFI': 6.Ninety two, 'KIRK':
8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33
, Output the entire value of the purchased stocks of stock to two decimal locations.
The answer output must be inside the layout:
Total charge: $cost_of_stocks
shares = 'TSLA': 912.86, 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92, 'KIRK': 8.Seventy two,
'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33
total = 0
print("Enter a amount of shares observed by stock symbol(s):")
num_items = int(enter())
for i in range(num_items):
item = enter()
if item in shares.Keys():
overall += stocks[item]
print(f'Total price: $general:.2f')
Create a solution that accepts a string input representing a grocery save object and an integer
input identifying the quantity of objects purchased on a recent visit. The following dictionary
purchase lists to be had items as the important thing and the cost in line with item because the
fee.
Buy = "bananas": 1.85, "steak": 19.Ninety nine, "cookies": 4.Fifty two, "celery": 2.81, "milk":
four.34
Additionally,
If fewer than 10 gadgets are purchased, the fee is the entire value in step with object.
If between 10 and 20 objects (inclusive) are purchased, the purchase gets a 5% discount.
If 21 or extra items are purchased, the purchase gets a ten% bargain.
Output the selected item and the overall buy price to 2 decimal locations.
The answer output should be in the layout:
amount item_purchased general price: $total_purchase_cost
buy = "bananas": 1.Eighty five, "steak": 19.Ninety nine, "cookies": four.52, "celery": 2.Eighty one,
"milk": four.34
print("Enter the object to buy:")