I&C SCI 31 Midterm: Midterm 1 - 1

108 views4 pages

Document Summary

Remember zero-based indexing: print((10 + 3) * 2) 26, print(11 / 2) 5. 5 c) x = 25 print(x * 2 == 50) true, print(x / 2 >= 50, a = "honda" = "audi" print(a + b) hondaaudi f) c = len(a) + len(b) print(c) 9: print(a) honda, print(a[1]) o. L = ["ford", "chevrolet", "toyota", "nissan", "tesla": len(l) 5 (b) len(l[1]) 9 (c) l[2] toyota (d) l[4] + "***" tesla*** (e) l[1] == l[2] false. Anteater autos represents each car in its inventory with: Suppose that anteater autos has a python list of 100 auto objects, called al, and this definition: def auto_price (a: auto) -> float: """ return the price of the auto """ return a. price. Fill in each blank below with one python variable name, function name, method name, constant, or operator, to satisfy the problem specification. (a) (1 point) sort the list by price, lowest to highest.