SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 04 Jan 2018 My Price 10.00

"Design the loop logic for a program that outputs

I need help editing my python code so that it completes everything on this assignment. 

 

"Design the loop logic for a program that outputs every number from 1 through 20 along with its value doubled and tripled. Accepting a user input and have the program output every number from 1 through the user’s number along with its value doubled and tripled. When finished, the program will ask the user to enter another number or enter a zero to quit."

 

Thanks in advance!

#num = user input of a number

#addNumber = working variable for user input of a number

#Programmer: Eric H

 

def getNumber():

    global num1

    global addNumber

    addNumber=1

    print("")

    num1=int(input("Enter a number or a 0 to quit: "))

 

while True:

    try:

        print("")

        print("*** FUN WITH SUMS***")

        getNumber()

        print("")

        print("Your number was:",num1)

    except ValueError:

        print("Incorrect entry please enter a number")

        continue

    if num1!=0:

        while addNumber<=num1:

            print("Loop",addNumber,">>>",num1,"+",addNumber,"=",addNumber+num1)

            addNumber=addNumber+1

            continue

    else:

        print("Goodbye")

        break

   

 

 

 

 

 

 

 

 

   

Answers

(5)
Status NEW Posted 04 Jan 2018 02:01 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)