Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40822

Re: Need help deriving a convertion function on python

References <891bd56d-5821-4268-8fa2-ba54e3a08d22@googlegroups.com>
Date 2013-03-08 07:40 +1100
Subject Re: Need help deriving a convertion function on python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3054.1362688829.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Mar 8, 2013 at 7:25 AM,  <johnnyukpo@gmail.com> wrote:
> Good day,
>
> I have a computer programming assignment. I am completely lost and i need some help.
>
> These are the questions that are confusing me
> (a) Write a function which converts from gallons to cups2
> (b) Now we’d like to be able to convert from cups to milliliters, since metric measurements
> are easier to convert between. Implement a function which does this.
> (c) We’d also like to be able to easily convert gallons into milliliters, so implement a
> function which does this

Here's a good place to start:

http://docs.python.org/3/tutorial/

After that, think about your task as three sub-tasks:

1) Get and parse input - what does your human need to tell your program?
2) Processing - the actual conversion, the meaty mathematical stuff
3) Produce output - what does your program report to your human?

Then start work on any one of the three. If you get stuck, move on to
one of the others. Once you've put some code together, test it, play
with it, and refine it. And if you get stuck, THEN come and ask for
help; but first, try to solve the problem yourself.

The purpose of this assignment is to help you learn to write code, so
we're not going to simply give you the code :) By the way, you may
find the python-tutor list more suitable, if you feel your questions
are particularly basic:
http://mail.python.org/mailman/listinfo/tutor

The Python tutorial really is a very good place to start. I'm
seriously considering giving it to a ten-year-old girl, granting her
just IDLE and a web browser, and seeing what she can accomplish in a
day.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Need help deriving a convertion function on python johnnyukpo@gmail.com - 2013-03-07 12:25 -0800
  Re: Need help deriving a convertion function on python Chris Angelico <rosuav@gmail.com> - 2013-03-08 07:40 +1100
  Re: Need help deriving a convertion function on python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-07 14:15 -0800
  Re: Need help deriving a convertion function on python Dave Angel <davea@davea.name> - 2013-03-07 19:07 -0500

csiph-web