Statement printed by following code snippet

Assignment Help Basic Computer Science
Reference no: EM131898963

Python Repetition

Below are the 3 questions that I have not been able to get right listed as A, B, C w/ multiple choice:

A) The second to last statement printed by the following code snippet will be ________.

letter1 = 'a'

letter2 = '?'

while letter1 <= 'z': # Outer loop

letter2 = 'a'

while letter2 <= 'z': # Inner loop

print('%s%s.com' % (letter1, letter2))

letter2 = chr(ord(letter2) + 1)

letter1 = chr(ord(letter1) + 1)

a. zy.com

b. zz.com

c. zx.com

d. yz.com

B)Given the following while loop, what is the value assigned to variable z for the given values of variables a = 1, b = 1 and c = 0?

mult = 0

while a < 10:

mult = b * a

if mult > c:

break

a = a + 1

z = a

 a. 0

 b. 1

 c. 2 (incorrect)

 d. -1

C) Consider the following code snippet. If num_a is 24 and num_b is 72, then the output will be _____.

num_a = int(input('Enter first positive integer:n'))

num_b = int(input('Enter second positive integer:n'))

while num_a != num_b:

if num_b > num_a:

num_b = num_b - num_a

else:

num_a = num_a - num_b

print('GCD is %d' % num_a)

a. The larch

b. 24

c. 12

d. 6

Reference no: EM131898963

Questions Cloud

What aspects of the new planet would you look : What aspects of this new planet would you look for to ensure survivability of our species? Some of specifics you may want to discuss Size and age of the planet.
What is the profitability index of investment : If the appropriate Cost of Capital (quoted interest rate) is 8.6 %, what is the Profitability Index of the investment?
Write program that asks for the number of credits : Write program that asks for the number of credits and a letter grade for a course. Each letter grade has a point value:
Explain job analysis-job descriptions and specifications : Rationalize your compensation and benefits package. Be sure to indicate the research and considerations that went into the design of the compensation.
Statement printed by following code snippet : Below are the 3 questions that I have not been able to get right listed as A, B, C w/ multiple choice:
How do the companies compare in terms of performance : Given this small sample of information, how do the companies compare in terms of performance? Which company is more profitable?
Liquidity premium and maturity risk premium : Explain how the component of interest rates such as real risk free rate, inflation rate ,default risk premium, liquidity premium and maturity risk premium.
Type of common troubleshooting problems : What type of common troubleshooting problems have you experienced on catalyst switches? If you have not performed actual troubleshooting
Explain the various forms of entertainment media : A 350- to 700-word paper in which you investigate the interrelationship between the entertainment media and culture. Answer the following questions.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Creating a new network application that allows employees

Your company is creating a new network application that allows employees to view their pay checks subs electronically via the Internet. Should this application be connectionless or connection oriented? Defend your answer, and using Visio draw a serie..

  Understand how the distance vector algorithm

To understand how the distance vector algorithm in Table 20.1 works, let us apply it to a four-node internet as shown in Figure 20.32.

  Add a schedule using microsoft project software amend wbs

Add a Schedule Using Microsoft Project software amend your WBS to include the schedule of time required to complete your project.

  Explain what the p-value means in this context

Even though this reading method has been shown to be significantly better, why might you not recommend that your local school adopt it?

  In what fraction of all cycles is the data memory used

In what fraction of all cycles is the input of the sign-extend circuit needed? What is this circuit doing in cycles in which its input is not needed?

  Explain the effects of internet on strong brands

Explain the effects you believe the Internet's capabilities will have on the brands you identified in the previous discussion and what the owner of the brand should do in light of them.

  Basis of the linear transformation range

a) Enter a basis of the linear transformation's kernel, as a list of vectors, for example (1,2,3),(4,5,6)? b) Enter a basis of the linear transformation's range?

  Risks of participating in social networking services

Much has been written about the benefits and risks of participating in social networking services such as Facebook and MySpace. What are some of the controversies associated with these forums?

  What is concurrency control

What is Concurrency control? Describe the type of concurrency control and its use.

  Write the standard form of the equation of the circle

Write the standard form of the equation of the circle that passes through the points with the given coordinates. Then identify the center and radius.

  What confidence level did the pollsters use

The reporter goes on to say that the margin of error for this poll was 3%.

  Using jflap construct a turing machine

Using JFLAP construct a turing machine that does integer division for numbers in unary notation. For example your machine should execute the calculation

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd