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


Groups > comp.lang.python > #54631

Help with python functions?

X-Received by 10.224.96.136 with SMTP id h8mr562160qan.8.1379941054909; Mon, 23 Sep 2013 05:57:34 -0700 (PDT)
X-Received by 10.49.53.70 with SMTP id z6mr1008qeo.29.1379941054892; Mon, 23 Sep 2013 05:57:34 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!d5no1606530qap.0!news-out.google.com!gv3ni1256qab.0!nntp.google.com!d5no1536068qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Mon, 23 Sep 2013 05:57:34 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=198.151.130.146; posting-account=hr1E-woAAADNjPTt4DadGtfyke-Rk1wn
NNTP-Posting-Host 198.151.130.146
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <e484b709-1287-4e6a-bc43-05f02a608579@googlegroups.com> (permalink)
Subject Help with python functions?
From kjakupak@gmail.com
Injection-Date Mon, 23 Sep 2013 12:57:34 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Lines 19
Xref csiph.com comp.lang.python:54631

Show key headers only | View raw


1.a. Write a function temp(T, from_unit, to_unit) where from_unit and to_unit are temperature units, either 'F' (or 'f') for fahrenheit, or 'C' (or 'c') for celsius, or 'K' (or 'k') for kelvin; and T is a temperature number for the unit from_unit. The function should return the temperature number in the unit to to_unit; no unit is returned. [input(...) and print(...) are not allowed]

1.b. Write a function comp(T1, u1, T2, u2) where u1, u2 are temperature units as in 1.a., and T1, T2 are temperature numbers for these units. The function should return -1 if T1 in u1 is a lower temperature than T2 in u2; it should return 0 is the two express equal temperatures; and it should return 1 otherwise. 

2. Write a function P(p_0, t, i) where t is a time in years *integer), is is a yearly interest (as a traditional percentage), and p_0 is the initial principal (at time 0). The function should return the principal at time t. Principals and interests are float numbers.

Can anyone help me with any of these please? Much appreciated. I honestly don't even know how to start them

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


Thread

Help with python functions? kjakupak@gmail.com - 2013-09-23 05:57 -0700
  Re: Help with python functions? Roy Smith <roy@panix.com> - 2013-09-23 09:11 -0400
  Re: Help with python functions? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-23 13:56 +0000
    Re: Help with python functions? kjakupak@gmail.com - 2013-09-23 15:32 -0700
      Re: Help with python functions? Terry Reedy <tjreedy@udel.edu> - 2013-09-23 18:48 -0400
      Re: Help with python functions? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-24 03:08 +0000
      Re: Help with python functions? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-24 03:17 +0000
      Re: Help with python functions? giacomo boffi <pecore@pascolo.net> - 2013-09-24 18:53 +0200
        Re: Help with python functions? MRAB <python@mrabarnett.plus.com> - 2013-09-24 18:18 +0100
    Re: Help with python functions? kjakupak@gmail.com - 2013-09-23 15:55 -0700
      Re: Help with python functions? Dave Angel <davea@davea.name> - 2013-09-24 00:07 +0000
        Re: Help with python functions? kjakupak@gmail.com - 2013-09-23 18:23 -0700
          Re: Help with python functions? Dave Angel <davea@davea.name> - 2013-09-24 03:52 +0000
      Re: Help with python functions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-24 02:12 +0000
        Re: Help with python functions? kjakupak@gmail.com - 2013-09-23 19:40 -0700
          Re: Help with python functions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-24 14:51 +0000
            Re: Help with python functions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-24 19:42 +0000
              Re: Help with python functions? kjakupak@gmail.com - 2013-10-01 10:53 -0700
                Re: Help with python functions? random832@fastmail.us - 2013-10-01 15:02 -0400
                Re: Help with python functions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-01 21:45 +0000
                Re: Help with python functions? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-10-01 19:19 -0400
      Re: Help with python functions? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-24 03:15 +0000
        Re: Help with python functions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-24 15:02 +0000

csiph-web