You are viewing our Forum Archives. To view or take place in current topics click here.
Python Programming HELP!
Posted:
Python Programming HELP!Posted:
Status: Offline
Joined: Apr 30, 201113Year Member
Posts: 710
Reputation Power: 28
Status: Offline
Joined: Apr 30, 201113Year 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.
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:
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
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Apr 30, 201113Year Member
Posts: 710
Reputation Power: 28
Status: Offline
Joined: Apr 30, 201113Year 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.
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.
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.