Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started