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

Easy Python HelpPosted:

Yerginator1
  • Ladder Climber
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 346
Reputation Power: 13
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 346
Reputation Power: 13
Alright, so I have an assignment due to tomorrow for my Computers Programming class. We're just getting started so we're learning with Python. The assignment is to print a list of the temperature conversions from celsius (0 to 100, by 10) to fahrenheit using a for loop.

This is what I have:
for celsius in range (0,101,10):
    fahrenheit = (9.0/5.0) * float(celsius) + 32
    print celsius + "degrees Celsius = " + fahrenheit + "degrees Fahrenheit."

Clearly, I need some help, or at least a nudge in the right direction. I think the problem is in the last line, I'm not completely sure how to concatenate stuff. Anyways, thanks in advance for any and all help.
#2. Posted:
Yerginator1
  • Ladder Climber
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 346
Reputation Power: 13
Status: Offline
Joined: Jul 03, 201014Year Member
Posts: 346
Reputation Power: 13
I got it, I had to convert celsius and fahrenheit into strings.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.