Question: 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]
 Activity #3: Python code soup - individual Create a program named

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!