Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions