Re: [Tutor] HELP PLEASE

2019-08-13 Thread Alan Gauld via Tutor
On 13/08/2019 12:09, Sithembewena L. Dube wrote: > Hi Marissa, > > I really think that you could consider doing an introductory Python > tutorial and then venture back into solving this problem. >>> This is the output of my updated code: >>> Traceback (most recent call last): >>> File "/Applicat

Re: [Tutor] HELP PLEASE

2019-08-13 Thread Sithembewena L. Dube
Hi Marissa, I really think that you could consider doing an introductory Python tutorial and then venture back into solving this problem. Understanding concepts like data types, function syntax and loops makes all the difference in approaching programming challenges. Here is a decent and free on

Re: [Tutor] HELP PLEASE

2019-08-13 Thread Cameron Simpson
On 12Aug2019 15:11, Marissa Russo wrote: This is my code: Thank you. This is the output of my updated code: Traceback (most recent call last): File "/Applications/Python 3.7/exercises .py", line 37, in main() File "/Applications/Python 3.7/exercises .py", line 33, in main m = mean(d

Re: [Tutor] HELP PLEASE

2019-08-13 Thread David L Neil
On 13/08/19 7:11 AM, Marissa Russo wrote: 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,

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 = x.read

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 ot

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() > > print("T

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 define

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 cop

Re: [Tutor] Help Please

2019-02-21 Thread DL Neil
Mario, On 21/02/19 3:30 AM, Mario Ontiveros wrote: Hello, I am new to python and have been stuck on this for a while. What I am trying to do is to remove rows with void, disconnected, and error on lines. The code I have does that, the only problem is that it removes my header because voi

Re: [Tutor] Help Please

2019-02-20 Thread Alex Kleider
On 2019-02-20 06:30, Mario Ontiveros wrote: Hello, I am new to python and have been stuck on this for a while. What I am trying to do is to remove rows with void, disconnected, and error on lines. The code I have does that, the only problem is that it removes my header because void is in head

Re: [Tutor] Help Please

2019-02-20 Thread Alan Gauld via Tutor
On 20/02/2019 14:30, Mario Ontiveros wrote: > Hello, > I am new to python and have been stuck on this for a while. What I am > trying to do is to remove rows with void, disconnected, and error on lines. > The code I have does that, the only problem is that it removes my header > because void

Re: [Tutor] Help Please

2019-02-20 Thread Mark Lawrence
On 20/02/2019 14:30, Mario Ontiveros wrote: Hello, I am new to python and have been stuck on this for a while. What I am trying to do is to remove rows with void, disconnected, and error on lines. The code I have does that, the only problem is that it removes my header because void is in

Re: [Tutor] Help please

2018-10-12 Thread Alan Gauld via Tutor
On 12/10/18 04:31, Adam Eyring wrote: > Also, it looks better to use " + " instead of a comma: > print("Combining these foods will you," + new_food) It may "look better" but be aware that they don't do the same thing and the plus sign is a lot less efficient computationally since it creates a new

Re: [Tutor] Help please

2018-10-12 Thread Mark Lawrence
On 12/10/18 04:31, Adam Eyring wrote: The program works as is in Python3. For Python2, change input to raw_input and see if that makes it work (I know it worked for me when I had Python2). Also, it looks better to use " + " instead of a comma: print("Combining these foods will you," + new_food)

Re: [Tutor] Help please

2018-10-12 Thread Adam Eyring
The program works as is in Python3. For Python2, change input to raw_input and see if that makes it work (I know it worked for me when I had Python2). Also, it looks better to use " + " instead of a comma: print("Combining these foods will you," + new_food) Also, colons and spaces are good practic

Re: [Tutor] Help please

2018-10-11 Thread Carlton Banks
https://www.w3schools.com/python/ref_func_input.asp tor. 11. okt. 2018 18.51 skrev Carlton Banks : > What are you trying to do? > > tor. 11. okt. 2018 18.33 skrev Holly Jo : > >> >> I have no clue what I’m doing wrong, I’m a new student >> >> food_1=input("Sushi") >> food_2=input("Quesdilla") >>

Re: [Tutor] Help please

2018-10-11 Thread Carlton Banks
What are you trying to do? tor. 11. okt. 2018 18.33 skrev Holly Jo : > > I have no clue what I’m doing wrong, I’m a new student > > food_1=input("Sushi") > food_2=input("Quesdilla") > new_food=food_1+food_2 > print("Combining these foods will you,",new_food) > input("Press enter to continue") > >

Re: [Tutor] Help please

2018-10-11 Thread Alan Gauld via Tutor
On 11/10/18 04:19, Holly Jo wrote: > > I have no clue what I’m doing wrong, I’m a new student > > food_1=input("Sushi") > food_2=input("Quesdilla") > new_food=food_1+food_2 > print("Combining these foods will you,",new_food) > input("Press enter to continue") Please always tell us what has gon

Re: [Tutor] help please

2018-10-10 Thread Mirage Web Studio
You are using the same variable name twice. You may use "rivers" for the dict and "river" for values. Also use descriptive names for variables. For eg if you correct the above mistake, the next one will be this line for rivers in rivers.values(): print (rivers) and sorry for top positing.

Re: [Tutor] help please

2018-10-10 Thread Deepak Dixit
On Wed, Oct 10, 2018, 12:37 PM Michael Schmitt wrote: > To whom it may concern: > > > I am trying to teach myself Python and ran into a problem. This is my code > > > # name of rivers and country > > rivers = {'nile' : 'egypt', 'ohio' : 'US', 'rhine' : 'germany' } > > # prints river name > for ri

Re: [Tutor] help please

2018-10-10 Thread Abdur-Rahmaan Janhangeer
i think it should have been for river in rivers instead of for rivers in rivers Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyth

Re: [Tutor] help please

2018-10-10 Thread Peter Otten
Michael Schmitt wrote: > To whom it may concern: > > > I am trying to teach myself Python and ran into a problem. This is my code > I am getting the following error > for rivers in rivers.values(): > AttributeError: 'str' object has no attribute 'values' > # prints river name > for rivers in

Re: [Tutor] Help Please on python

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 02:12, Laura Garcia wrote: > I need to create a python code that should simulate throwing darts by > random landing between (a random x and a random y)0 and 1. and the program > should print out number of darts that land within a rectangle. Look in the random module. There are a bunc

Re: [Tutor] Help please

2016-10-20 Thread Alan Gauld via Tutor
On 20/10/16 21:25, Karen Palladino wrote: > I am new to python and programming for that matter. Basically, I don't know > much at all. I have python on my p/c which was put there by a former > co-worker who wrote a program that extracts bites of information to generate > a report. The format of th

Re: [Tutor] Help please

2013-10-17 Thread Alan Gauld
On 17/10/13 14:37, Peter Otten wrote: Alan Gauld wrote: [Ruben Pinedo] def process_file(filename): hist = dict() fp = open(filename) for line in fp: process_line(line, hist) return hist or somebody is just sloppy. But neither work as expected right now. (Hint: C

Re: [Tutor] Help please

2013-10-17 Thread Kengesbayev, Askar
Ruben, #1 you can try something like this try: with open('my_file.txt') as file: pass except IOError as e: print "Unable to open file" #Does not exist or you do not have read permission #2. I would try to use regular expression push words to array and then you

Re: [Tutor] Help please

2013-10-17 Thread Dominik George
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Todd Matsumoto schrieb: >> #1. Error handling for the files to ensure reading only .txt file >Look up exceptions. >Find out what the string method endswith() does. One should note that the OP probably meant files of the type text/plain rather than

Re: [Tutor] Help please

2013-10-17 Thread Peter Otten
Alan Gauld wrote: [Ruben Pinedo] > def process_file(filename): > hist = dict() > fp = open(filename) > for line in fp: > process_line(line, hist) > return hist > > def process_line(line, hist): > line = line.replace('-', ' ') > > for word in line.split(): >

Re: [Tutor] Help please

2013-10-17 Thread Alan Gauld
On 16/10/13 19:49, Pinedo, Ruben A wrote: I was given this code and I need to modify it so that it will: #1. Error handling for the files to ensure reading only .txt file I'm not sure what is meant here since your code only ever opens 'emma.txt', so it is presumably a text file... Or are you

Re: [Tutor] Help please

2013-10-17 Thread Todd Matsumoto
Hello Ruben, You might already know this, but the Python documentation will get you pretty far: http://www.python.org/doc/ Here are some things to lookup that may help you solve the problems. On 10/16/2013 08:49 PM, Pinedo, Ruben A wrote: I was given this code and I need to modify it so that

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-26 Thread David Robinow
On Wed, Sep 25, 2013 at 9:34 PM, Dave Angel wrote: > Clearly gmail isn't showing you all the headers. I looked for Alan's > message in one of these threads with the same subject, and see about 60 > lines of header information. Does gmail have a View->Source menu item? > In gmail the menu item i

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-26 Thread Steven D'Aprano
On Thu, Sep 26, 2013 at 12:24:41AM +0200, Dino Bektešević wrote: > > Message: 1 and later: > Message: 4 I don't suppose you are replying to a message digest, are you? If so, thank you for changing the subject line to something more useful than just "Re Digest", and thank you even more for trim

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread eryksun
On Wed, Sep 25, 2013 at 6:24 PM, Dino Bektešević wrote: > > Where did you find that In-Reply-To: field? In example Alan's response > header Gmail has a "Show original" link in the message drop-down menu. But in this case I just searched the September text archive: https://mail.python.org/piperma

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread Dave Angel
On 25/9/2013 18:24, Dino Bektešević wrote: > > Where did you find that In-Reply-To: field? In example Alan's response > header, including the quoted section is shown to me as: > > Message: 4 > Date: Mon, 23 Sep 2013 18:21:03 +0100 > From: Alan Gauld > To: tutor@pyt

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread Dino Bektešević
> Message: 1 > Date: Wed, 25 Sep 2013 06:29:30 -0400 > From: eryksun > To: Dino Bekte?evi? > Cc: tutor@python.org > Subject: Re: [Tutor] HELP Please!!!How Do I Make a Graph Chart > Generate in Python Based on my Code > Message-ID: > > Content-T

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread znxm0i
Thanks Brian for replying but I already figured out what I was not doing correctlyalso the link you supplied was not what I needed.I had to make the user input statements appear as graphical input boxes and not just text and I figured out how to do it, so it now works like a charm

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread Dave Angel
On 24/9/2013 21:15, Dino Bektešević wrote: > Hello, > > I wrote a response on the subject in the title about creating a graph > in Python using the Graphics module presented in the standard python > tutorial on 23rd detailing full explanations but I still saw repeated > responses asking more of th

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread eryksun
On Tue, Sep 24, 2013 at 9:15 PM, Dino Bektešević wrote: > > original question: http://code.activestate.com/lists/python-tutor/96889/ > my response: http://code.activestate.com/lists/python-tutor/96897/ > > For someone browsing through Tutor in archive form I can see how this > is a tad confusing,

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-25 Thread Dino Bektešević
Hello, I wrote a response on the subject in the title about creating a graph in Python using the Graphics module presented in the standard python tutorial on 23rd detailing full explanations but I still saw repeated responses asking more of the same question (lines causing the error, which graphic

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-24 Thread brian arb
http://mcsp.wartburg.edu/zelle/python/ppics1/code/chapter05/futval_graph2.py On Tue, Sep 24, 2013 at 4:36 PM, School wrote: > What is the error you received? What lines does it say are causing the > error? > > Also, this smells like classwork. > > On Sep 20, 2013, at 21:26, znx...@yahoo.com wro

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-24 Thread School
What is the error you received? What lines does it say are causing the error? Also, this smells like classwork. On Sep 20, 2013, at 21:26, znx...@yahoo.com wrote: > Can anyone please help me figure out what I am NOT doing to make this program > work properly.PLEASE !! > > I need to be able

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-24 Thread bob gailer
In addition to Alan's comment: Saying "it work properly" is totally uninformative. Tell us what is happening that you want different. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscript

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code (znx...@yahoo.com)

2013-09-23 Thread Dino Bektešević
Hello, > I have attached a copy of the code I've compiled so far. Next time just post the code in here, I think that's the general consensus around here. You should only attach it or use a pastebin if it's really really long. Considering that usually the only valid entries here are snippets of co

Re: [Tutor] HELP Please!!!....How Do I Make a Graph Chart Generate in Python Based on my Code

2013-09-23 Thread Alan Gauld
On 21/09/13 04:26, znx...@yahoo.com wrote: Can anyone please help me figure out what I am NOT doing to make this program work properly.PLEASE !! First you need to tell us what "graphics" module you are using since there is no standard library module by that name. Second, you should probabl

Re: [Tutor] Help Please

2013-07-10 Thread Dave Angel
On 07/05/2013 05:10 PM, Ashley Fowler wrote: This is what I have so far. Can anyone make suggestions or tell me what I need to correct? * * First thing to correct is the notion that you're due an instant answer. You get frustrated after 3 minutes, and post a new messa

Re: [Tutor] Help please!

2012-12-14 Thread Steven D'Aprano
On 02/12/12 12:37, Jack Little wrote: Hi Tutor, I'm getting this error Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined Names need to be defined before they are used. Code needs to be indented to b

Re: [Tutor] Help please!

2012-12-14 Thread Kwpolska
On Sun, Dec 2, 2012 at 2:37 AM, Jack Little wrote: > Hi Tutor, > I'm getting this error > > Traceback (most recent call last): File "C:\Users\Jack\Desktop\python\g.py", > line 45, in path_1pt1() NameError: name 'path_1pt1' is not defined > > With the attached file > > Please get back to me > Than

Re: [Tutor] Help please!

2012-07-31 Thread ttmticdi .
>> Ex: >> > No! >> print "Hi %s! You like %s and %s" (user_name, x, y) >> > Yes! > print "Hi %s! You like %s and %s" % (user_name, x, y) >> >> >>> Forgot the interpolation operator(%). Thank you very much Joel for correcting me. Regards, ttmticdi. ___

Re: [Tutor] Help please!

2012-07-31 Thread Joel Goldstick
On Tue, Jul 31, 2012 at 5:52 AM, ttmticdi . wrote: >> > print "Mum is in a %s mood" % (mum_mood) >> > print "Dad is in a %s mood" % (dad_mood) >> >> > > > Hi Victoria! > > Since you have only one format character in the strings above there is > no need to surround the variables mum_mood and dad_mo

Re: [Tutor] Help please!

2012-07-31 Thread ttmticdi .
> > print "Mum is in a %s mood" % (mum_mood) > > print "Dad is in a %s mood" % (dad_mood) > > Hi Victoria! Since you have only one format character in the strings above there is no need to surround the variables mum_mood and dad_mood with parenthesis. You only do that when you have multiple form

Re: [Tutor] Help please!

2012-07-30 Thread Prasad, Ramit
> Hello all! I have a very simple question but I'm very new to python. Could you > describe to me what the following piece of Python code says in English > please? Welcome to the list and Python! When posting code in the future I recommend posting in plain text and not "rich" text or HTML. If you

Re: [Tutor] Help please!

2012-07-30 Thread Emile van Sebille
On 7/30/2012 12:52 PM Victoria Homsy said... Hello all! I have a very simple question but I'm very new to python. Could you describe to me what the following piece of Python code says in English please? def print_a_line(line_count, f): print line_count, f.readline() This function accepts

Re: [Tutor] Help please!

2012-07-30 Thread Puneeth Chaganti
On Mon, Jul 30, 2012 at 9:35 PM, Victoria Homsy wrote: > Hi! I am a new Python user, and would really appreciate some help. My code > is as follows: > > from sys import argvs > script, mum_mood, dad_mood = argvs > > # my own function > def dad_and_mum_mood(mum_mood, dad_mood): > print "If both mum

Re: [Tutor] Help Please

2007-01-28 Thread Alan Gauld
"Python Freak" <[EMAIL PROTECTED]> wrote > This may be too elementary for most of you, but could you please > help me > with the following question? I would like to use comprehensive lists > and > lists of lists. Where do I start? Assuming you mean list comprehensions and lists of lists then m

Re: [Tutor] Help Please

2007-01-28 Thread Danny Yoo
> This may be too elementary for most of you, but could you please help me > with the following question? This is almost certainly a homework problem. We are very restricted in what we can do to help. See: http://www.catb.org/~esr/faqs/smart-questions.html#homework > I would like to u

Re: [Tutor] help [Please use better subject lines than "help!"]

2005-03-13 Thread Danny Yoo
On Sun, 13 Mar 2005, R. Alan Monroe wrote: > > ok i have learned that on the python shell or new window you can > > type in..print "hello world"...and the output is ..'hello > > world'.. or you can put in anything realy and it say it back to > > you.is this a program or what > >