[Tutor] HELP PLEASE

2019-08-12 Thread Marissa Russo
Hello, I am trying to figure out what is going on and why my output is saying “” instead of giving me a number. Please let me know if you see the error in my code!! import math def get_numbers(): print("This program will compute the mean and standard deviation") file1 = input("Please

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
On 12/08/2019 17:54, Marissa Russo wrote: > def mean(nums): > for num in nums: > _sum += num > return _sum / len(nums) > > def mean2(nums2): > for num in nums2: > _sum += nums2 > return _sum / len(nums2) > > def main(): > data = get_numbers() > >

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Joel Goldstick
On Mon, Aug 12, 2019 at 1:22 PM Marissa Russo wrote: > > Hello, > > I am trying to figure out what is going on and why my output is saying > “” instead of giving me a number. Please let me know if > you see the error in my code!! > Marissa, you have lots of problems here. First, you should

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Mats Wichmann
On 8/12/19 10:54 AM, Marissa Russo wrote: > Hello, > > I am trying to figure out what is going on and why my output is saying > “” instead of giving me a number. Please let me know if > you see the error in my code!! to quickly illustrate the specific question you asked - you got comments on

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Sithembewena L. Dube
In your calls to the `*print*` function, you are not calling the `*mean*` and `*mean2*` functions that you declared to calculate averages. So Python sees you trying to concatenate two function objects to strings and is not happy. That's one thing. Secondly, your code could be refactored to

Re: [Tutor] class functions/staticmethod?

2019-08-12 Thread Steven D'Aprano
Part 3. On Sun, Aug 11, 2019 at 10:58:37PM -0500, James Hartley wrote: > from collections import namedtuple > > class Foo(): > Dimensions = namedtuple('Dimensions', ['height', 'width']) > _dimensions = Dimensions(3, 4) > > def dimensions(): > print('id =

Re: [Tutor] class functions/staticmethod?

2019-08-12 Thread Peter Otten
James Hartley wrote: > I am lacking in understanding of the @staticmethod property. > Explanation(s)/links might be helpful. I have not found the descriptions > found in the Internet wild to be particularly instructive. Given the code > below: > =8<-- > from collections

Re: [Tutor] HELP PLEASE

2019-08-12 Thread Marissa Russo
This is my code: import math def get_numbers(): print("This program will compute the mean and standard deviation") file1 = input("Please enter the first filename: ") file2 = input("Please enter the second filename: ") x = open(file1, "r") y = open(file2, "r") nums =

Re: [Tutor] Fwd: Re: HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
On 12/08/2019 19:35, Alan Gauld via Tutor wrote: > To save some typing convert the?? int conversion loop into a function: > > > def?? to_ints(strings): > ?? num_copy = [] > ?? for num in nums: > num_copy.append(float(num)) > > ?? return num_copy # No idea where

[Tutor] cgi module help

2019-08-12 Thread rmlibre
I have a question about the cgi module. I'm trying to retrieve post data as a nested dictionary from client code. For instance: """client code""" from requests import sessions from datetime import datetime session = sessions.Session() date = str(datetime.now()) msg_id = 0001 message =

[Tutor] Fwd: Re: HELP PLEASE

2019-08-12 Thread Alan Gauld via Tutor
Forwarding to tutorblist for info... Forwarded Message Subject:Re: [Tutor] HELP PLEASE Date: Mon, 12 Aug 2019 19:34:48 +0100 From: Alan Gauld Reply-To: alan.ga...@yahoo.co.uk To: Marissa Russo On 12/08/2019 19:17, Marissa Russo wrote: > I fixed some

Re: [Tutor] Union

2019-08-12 Thread Mats Wichmann
On 8/12/19 2:50 PM, Jim wrote: > I was reading the docs for PySimpbleGUI here: > https://pysimplegui.readthedocs.io/en/latest/#building-custom-windows > > In the table of parameters for the Window() function for example the > icon parameter the meaning is  Union[str, str] Can be either a filename

Re: [Tutor] Union

2019-08-12 Thread Jim
On 8/12/19 4:12 PM, Mats Wichmann wrote: On 8/12/19 2:50 PM, Jim wrote: I was reading the docs for PySimpbleGUI here: https://pysimplegui.readthedocs.io/en/latest/#building-custom-windows In the table of parameters for the Window() function for example the icon parameter the meaning is 

[Tutor] Union

2019-08-12 Thread Jim
I was reading the docs for PySimpbleGUI here: https://pysimplegui.readthedocs.io/en/latest/#building-custom-windows In the table of parameters for the Window() function for example the icon parameter the meaning is Union[str, str] Can be either a filename or Base64 value. What is the usage