Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: [1 marks] what will the following code output? def doThing (n): for in range(n,0,-3); print S) doThing (9) B. 18 C. 27 D.

image text in transcribedimage text in transcribed

Question 1: [1 marks] what will the following code output? def doThing (n): for in range(n,0,-3); print S) doThing (9) B. 18 C. 27 D. the code will not run or will run indefinitely Question 2: [1 marks] what will the following code output? def doSomethingElse (x): if x> 0: while x 1: x *- abs(x) else: X +- 1 return x print (doSomethingElse (10)) A. 10 B. -10 C.-100 the code will not run or will run indefinitely

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

How was their resistance overcome?

Answered: 1 week ago