You are viewing our Forum Archives. To view or take place in current topics click here.
Python Programming HELP!
Posted:

Python Programming HELP!Posted:

TotalTrigger
  • Rising Star
Status: Offline
Joined: Apr 30, 201112Year Member
Posts: 710
Reputation Power: 28
Status: Offline
Joined: Apr 30, 201112Year Member
Posts: 710
Reputation Power: 28
I need to complete two tasks due in tomorrow for assessment.

If somebody could help me with the working programs I would be greatly, and will rep.

First program,

Create a program which prints out '1 Looping' then '2 Looping' until it gets to 12, using a while loop.

Create a program that takes in a letter and number and prints out that letter that many times using a while loop.

I know this could be easy, but we've just started this language.

ANY help would be appreciated.

Thanks.
#2. Posted:
iyop45
  • Prospect
Status: Offline
Joined: Apr 15, 201113Year Member
Posts: 614
Reputation Power: 83
Status: Offline
Joined: Apr 15, 201113Year Member
Posts: 614
Reputation Power: 83

i = 1
while i < 13:
    print(str(i)+" Looping")
    i += 1



letter = input("Enter your letter:")
while len(letter) != 1:
    letter = input('Only one letter:')

times = input("How many times?")
while True:
    try:
        if int(times) >= 0:
            break
    except ValueError:
        times = input("Must be an integer greater than or equal to 0")

i = 0
while i < int(times):
    print(letter)
    i += 1
#3. Posted:
TotalTrigger
  • V5 Launch
Status: Offline
Joined: Apr 30, 201112Year Member
Posts: 710
Reputation Power: 28
Status: Offline
Joined: Apr 30, 201112Year Member
Posts: 710
Reputation Power: 28
Ahah, thanks a lot dude.

Not at a computer right now but sure it works.

Will check tomorrow.

And will remember to rep you.

Send me a personal message.

Thanks again dude.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.