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


Groups > comp.lang.python > #54332

Re: How do I calculate a mean with python?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'string.': 0.05; 'list?': 0.07; 'strings.': 0.09; 'subject:How': 0.10; 'def': 0.12; '"\\n")': 0.16; 'field):': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'list)': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'method;': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'input': 0.22; 'header :User-Agent:1': 0.23; 'number)': 0.24; "i've": 0.25; 'header:In- Reply-To:1': 0.27; 'fixed': 0.29; "doesn't": 0.30; '"")': 0.31; 'decimal': 0.31; 'subject:with': 0.35; 'equal': 0.35; 'received:84': 0.35; 'but': 0.35; 'thanks': 0.36; 'subject:?': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'read': 0.60; 'break': 0.61; 'numbers': 0.61; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'william': 0.81; 'everything.': 0.84; 'reply-to:addr:python.org': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=cNrZ7DuN c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=0kkAYlmtguIA:10 a=Jww8p7Z7i0IA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=qWbBzqlYqigA:10 a=pi6qvB81x8VcKgPjiNYA:9 a=-zahprnsSn1lFizI:21 a=zUZXkJT5dLAfLN7i:21 a=wPNLvfGTeEIA:10
X-AUTH mrabarnett:2500
Date Tue, 17 Sep 2013 22:26:58 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version 1.0
To python-list@python.org
Subject Re: How do I calculate a mean with python?
References <571f1251-17a5-44db-a859-17a6d8065151@googlegroups.com> <1540971c-7868-4f01-be3b-98fd5dffa985@googlegroups.com>
In-Reply-To <1540971c-7868-4f01-be3b-98fd5dffa985@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.90.1379453218.18130.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1379453218 news.xs4all.nl 15936 [2001:888:2000:d::a6]:60680
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54332

Show key headers only | View raw


On 17/09/2013 21:10, William Bryant wrote:
> Ok I think I've fixed it thanks I read everything.
>
[snip]
>
> def HMNs():
>      global TheStr, user_inputHMNs, List_input, List
>      user_inputHMNs = input("You picked string. This program cannot calculate the mean or median, but it can calculate the mode. :D  How many strings are you using in your list? (Can not be a decimal number)  \nEnter:  ")

This line doesn't do anything:

>      user_inputHMNs
>      time.sleep(1.5)
>      TheStr = int(user_inputHMNs)
>      for i in range(TheStr):
>          List_input = input("Enter your strings. (One in each input field):  ")
>          List.append(List_input)
>          print("Your list -> ", List)

List.count is a method; it will never equal an integer:

>          if List.count == int(user_inputHMNs):
>              break
>          print("\n*Mode*:", mode())
>          print("*Median*:",  "<Coming soon!>\n")
>          print("*Mean*:",    mean())
>
> def HMNn():
>      global TheNum, user_inputHMNn, List_input, List
>      user_inputHMNn = input("You picked number. :D How many numbers are you using in your list? (Can not be a decimal number) \nEnter:  ")

This line doesn't do anything:

>      user_inputHMNn
>      time.sleep(1.5)
>      TheNum = int(user_inputHMNn)
>      for i in range(TheNum):
>          List_input = input("Enter your numbers. (One in each input field):  ")
>          List_input = int(List_input)
>          List.append(List_input)
>          print("\nYour list -> ", List)

List.count is a method; it will never equal an integer:

>          if List.count == int(user_inputHMNn):
>              break
>          print("\n*Mode*:", mode())
>          print("*Median*:",  "<Coming soon!>")
>          print("*Mean*:",    mean())
>
[snip]

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


Thread

How do I calculate a mean with python? William Bryant <gogobebe2@gmail.com> - 2013-09-16 16:33 -0700
  Re: How do I calculate a mean with python? Jugurtha Hadjar <jugurtha.hadjar@gmail.com> - 2013-09-17 00:52 +0100
  Re: How do I calculate a mean with python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-16 23:55 +0000
  Re: How do I calculate a mean with python? MRAB <python@mrabarnett.plus.com> - 2013-09-17 01:01 +0100
  Re: How do I calculate a mean with python? Jugurtha Hadjar <jugurtha.hadjar@gmail.com> - 2013-09-17 01:08 +0100
  Re: How do I calculate a mean with python? Cameron Simpson <cs@zip.com.au> - 2013-09-17 09:59 +1000
  Re: How do I calculate a mean with python? Dave Angel <davea@davea.name> - 2013-09-17 00:50 +0000
  Re: How do I calculate a mean with python? Travis Griggs <travisgriggs@gmail.com> - 2013-09-17 08:25 -0700
  Re: How do I calculate a mean with python? William Bryant <gogobebe2@gmail.com> - 2013-09-17 12:44 -0700
  Re: How do I calculate a mean with python? William Bryant <gogobebe2@gmail.com> - 2013-09-17 12:45 -0700
  Re: How do I calculate a mean with python? William Bryant <gogobebe2@gmail.com> - 2013-09-17 13:10 -0700
    Re: How do I calculate a mean with python? Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-17 17:02 -0400
    Re: How do I calculate a mean with python? MRAB <python@mrabarnett.plus.com> - 2013-09-17 22:26 +0100
      Re: How do I calculate a mean with python? William Bryant <gogobebe2@gmail.com> - 2013-09-17 14:31 -0700
        Re: How do I calculate a mean with python? Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-17 19:49 -0400
  Re: How do I calculate a mean with python? Bryan Britten <britten.bryan@gmail.com> - 2013-09-17 18:53 -0700

csiph-web