






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







ANSWERS
h;times h;an h;employee h;travels h;to h;a h;job h;site. h;Output h;the h;total h;distance h;traveled h;to h;twoh;decimalh;placesh;givenh;theh;followingh;milesh;perh;employeeh;commuteh;toh;the h;job h;site. h;Output h;the h;total h;distance h;traveled h;to h;two h;decimal h;places h;given h;the h;following h;miles h;per h;employee h;commute h;to h;the h;job h;site: Employeeh;A:h;15.62h;miles h;Employee h;B:h;41.85 h;miles Employeeh;C:h;32.67h;miles:h;times_traveledAh;=h;int(input()) h;times_traveledB h;= h;int(input()) times_traveledCh;=h;int(input()) h;employeeA h;= h;15.62 h;#miles h;employeeB h;= h;41.85 h;#miles h;employeeC h;= h;32.67 h;#miles distance_traveledA h;= h;times_traveledA h;* h;employeeA h;distance_traveledB h;= h;times_traveledB h;* h;employeeB h;distance_traveledCh;=h;times_traveledCh;*h;employeeC
total_miles_traveled h;= h;distance_traveledA h;+ h;distance_traveledB h;+ h;distance_trav- h;eledC print('Distance:h;{:.2f} h;miles'.format(total_miles_traveled))
various_data_typesh;=h;[516,h;112.49,h;True,h;"meow",h;("Western",h;"Governors", h;"University"), h;{"apple": h;1, h;"pear": h;5}] Using h;the h;built-in h;function h;type() h;and h;getting h;its h;name h;by h;using h;the h;.name h;attribute,h;output h;data h;type h;(e.g.,h;int",h;"float",h;"bool",h;"str") h;based h;on h;the h;input h;index h;value h;of h;the h;list h;element.: h;index_value h;= h;int(input()) name h;= h;various_data_types[index_value] h;data_type h;= h;type(name). name h;print(f"Elementh;{index_value}:h;{data_type}")
print(x) if h;x h;> h;100: print('True') h;else: print('False')
third_output h;= h;str(num1) h;+ h;str(num2) h;+ h;str(num3) h;+ h;str(num4) h;+ h;str(num5) h;print('Integer: h;{}'.format(first_output)) print('Float:h;{}'.format(second_output)) h;print('String: h;{}'.format(third_output))
h;if h;num_items h;>= h;21: discount h;= h;total_cost h;* h;0.10 h;total_cost h;=h;total_costh;-h;discount print(store_item, h;'${:.2f}'.format(total_cost))
h;ature h;in h;degrees h;Fahrenheit. h;Output h;a h;description h;of h;the h;water h;state h;based h;on h;the h;following h;scale: If h;the h;temperature h;is h;below h;33° h;F,h;the h;water h;is h;"Frozen". If h;the h;water h;is h;between h;33° h;F h;and h;80° h;F h;(including h;33),h;the h;water h;is h;"Cold". If h;the h;water h;is h;between h;80° h;F h;and h;115° h;F h;(including h;80), h;the h;water h;is h;"Warm". h;If h;the h;water h;is h;between h;115° h;F h;and h;211° h;(including h;115) h;F, h;the h;water h;is h;"Hot". h;If h;the h;water h;is h;greater h;than h;or h;equal h;to h;212° h;F, h;the h;water h;is h;"Boiling". Additionally,h;outputh;ah;safetyh;commenth;onlyh;duringh;theh;followingh;circum- h;stances: If h;the h;water h;is h;exactly h;212° h;F,h;the h;safety h;comment h;is h;"Caution:h;Hot!" Ifh;the h;water h;temperature h;is h;less h;thanh;33°h;F,h;the h;safetyh;comment h;is h;"Watchh;out h;for h;ice!": h;temperature h;= h;int(input()) if h;temperature h;<33:
print('Frozen') h;print('Watchh;outh;forh;ice!') if h;temperature h;in h;range(33, h;80): print('Cold') if h;temperature h;in h;range(80, h;115): print('Warm') if h;temperature h;in h;range(115, h;211): print('Hot') if h;temperature h;>= h;212: print('Boiling') if h;temperature h;== h;212: print('Caution:h;Hot!')