Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Activity # 3 : Python code soup - individual Create a program named python _ code _ soup.py consisting of only the following lines of

Activity #3: Python code soup - individual
Create a program named python_code_soup.py consisting of only the following lines of code to produce the output shown below. You may put these lines of code in any order, and can re-use the lines as much as you want. There is more than one way to achieve the result - try to see if you can obtain the output using fewer lines of code. Hint: you can only print z to the screen, so you have to build the value of z that you want using the other statements, then print z.
x=1
y=10
z=0
x=y
x+=1
y+=x
y***=x
z+=x
z+=y
print (z)
You may also use blank lines and # style comments in your code (including the header), everything else will be marked as "not allowed"
For example, say that you wanted to print the number "1" to the screen. The following lines would do the trick:
z=0
x=1
z+=x
print (z)
Your program should print out the following, when run:
1
27
102
1000000000000
[Note: that's 1012]
8675
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

3. An overview of the key behaviors is presented.

Answered: 1 week ago

Question

2. The model is credible to the trainees.

Answered: 1 week ago