Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Python - Solved] Need help with first assignment  (Read 1573 times)

0 Members and 1 Guest are viewing this topic.
[Python - Solved] Need help with first assignmen...
« on: September 08, 2011, 01:54:09 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
PLEASE READ:  
Before you jump to conclusions about what I am doing wrong - I tried the arithmetic with all variables as floats.  It spat up an error:
Traceback (most recent call last):
  File "C:/Python27/proj01.py", line 9, in <module>
    int_final_distance = int_debt_distance / fl_moon_distance
TypeError: unsupported operand type(s) for /: 'float' and 'tuple'

So, I tried making integers since the Python manual says that all arithmetic functions return integers...I still get the error.  So, now I am stuck for the moment because our professor did not say anything in our class about this error nor did he try this arithmetic in class(which was 2 hours long).  He wants everyone to approach his class with a "noob" mindset.  Well, just like the reviews say of his book, he left information out.  I never used Python and not knowing that apparently you cannot directly divide floats would have been nice instead of ripping on those of us in class that have prior programming experience.

:tangent incoming:
He literally ripped on 3 people in class that said the word "declaring".  I sat there like "what the hell?".  Whatever.
/tangent

Anyway, I'm going to just post the actual file.  Just look over it and lead me to the correct direction.  Don't tell me how to literally fix it as apparently all assignments are filtered through some anti-cheat system.  Whatever, but I am not taking any chances.  Then again, what are the odds that 250 people writing a small program like this will be near the same as someonelse's from the last 3 years.

Check the file.  It's supposed to print the distance of money stacked from earth to the moon of the United States National Debt.  There's a website for it if you are curious. http://www.usdebtclock.org/

Well, I am going to keep at it.  Maybe I'll get it before someone else does but it is irritating at the moment.

EDIT: I just posted a new version that fixes some things I missed.
EDIT 2: NVM, got it.  apparently I placed an unnecessary comma in there.
« Last Edit: September 08, 2011, 02:03:11 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.054 seconds with 36 queries.

anything