Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92727309
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

How do you apply the five components of the information

How do you apply the five components of the information systems to an information systems application like "online bill pay" system offered by many banks.

Identify economic decision that is driven by a behavioral

Identify economic decision that is driven by a behavioral bias rather than by pure rational behavior. why are they differ today?

This is a simple exercise to introduce the use of arrays

This is a simple exercise to introduce the use of arrays and some of the common errors that occur when programming with them in c++. • Write a simple program that allows the user to enter 10 integers into an array, then ...

Companies persue closer coordination and collaboration with

Companies persue closer coordination and collaboration with channel suppliers to better address customer needs inorder to 1) Develop human resource management activities that improve the skills , expertise and knowledge ...

Write a python 3 program please show all outputlambda and

Write a Python 3 Program please show all output. lambda and keyword Magic Goals A bit of lambda functions as objects keyword evaluation Task Write a function that returns a list of n functions, such that each one, when c ...

Assignment 2 windows 8 upgradeby the due date assigned

Assignment 2: Windows 8 Upgrade By the due date assigned, submit your assignment to the Submissions Area. Scenario: You are a consultant for a company that is using Windows 7 as their operating system and are considering ...

Question social networks have become popular media among

Question : Social networks have become popular media among individuals of all ages to stay connected with friends, family, colleagues and coworkers. However, many users are unaware of the dangers of sharing vast amounts ...

Suppose you have an object made up of two w-bit integers x

Suppose you have an object made up of two w-bit integers, x and y. Suppose that the hash code for your object is defined by some deterministic function h(x; y) that produces a single w-bit integer. Prove that there exist ...

Question based upon your company profile install and

Question: Based upon your company profile, install and configure Windows Server within the virtual environment. 1. Ensure that the server name is appropriate for your corporation. 2. Create a complex password for the Adm ...

A student raises her hand in class and states i can legally

A student raises her hand in class and states, "I can legally copy any DVD I get from Netflix because Netflix purchased the DVD and the copyright only applies to the company who purchased the product." Explain whether th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As