Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com First time homework help using 2.75

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 06-11-2013, 02:56 AM PM User | #1 lunapt New to the CF scene   Join Date: Jun 2013 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts First time homework help using 2.75 using 2.75 Homework question here: http://imgur.com/aHLYwyQ I've just started learning python so i'm really lost... Do I start like x= year y= months x= 5 y= 9 print x*12 print y/12 + 11 this code is terribly, horribly, wrong, but this is my first time trying to learn python >< any help would be SO appreciated. thank you.
07-25-2013, 08:29 PM   PM User | #2
JabZero
New to the CF scene

Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Hello lunapt,

First, there are some redundancies in your code that I suggest to delete. For instance, do not not assign unnecessary dummy variables. You assign year to x, and then 5 to x. Simply, assign 5 to year; the same goes for months.

Second, you get a wrong result because your formula is wrong. Your assignment asks you to find number of months in year(s) plus some additional months. Thus, your formula should be
Quote:
Here is the code for the first part of the assignment, the second part is the reverse of the first. You should be able to figure that out. If not, ask.

Quote:
 years = 18 months = 27 answer = years*12 + months print years,' years and ',months,' months are equivalent to:', answer,' months'

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 06:17 PM.