Question: 5. String upper [A: Hello] Assume that there is a function toupper that takes a lower case letter and returns the upper case version of
![5. String upper [A: Hello] Assume that there is a function](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f543f6a95fd_75066f543f6230cb.jpg)
5. String upper [A: Hello] Assume that there is a function toupper that takes a lower case letter and returns the upper case version of the letter. For any other character it returns the character unchanged >>> toupperfa > toupper+) Now, given this function def strupper(string) for c in string c = toupper(c) and after running this line what is the final value in the variable s? A. Hello' B. HELLO C. 'hello' D. hELLO' E. HHHHH F. None >s-Hello'; strupper(s) 6 & 7. O0P 1: Car [C: 3.0, D: 2.0] Here are two class definitions class Car def init (self) self.price 20000 self gas-15 self.mpg = 25 # dollars # gallons # miles per gallon def drive(self, miles) self gas-= miles , self mpg class CompactCar(Car) def init (seif) self. price. 15000 # dollars # gallons # mies per gallon set gas = 12 seif mpg 30 Execute these statements: c1 Car() e2 CompactCar) c1 drive(300) c2.drive(300) Now arvswer these questions A 10 8. 25 C. 3 D 2E. 12 A 10 B. 25 C.3D 2E. 12 10. What is the value of c1.gas? 11. What is the value of c2.gas7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
