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
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
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
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,
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
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
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
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
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
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 e
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
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
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
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
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 header. I need to keep header.
Any help will b
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
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)
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
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")
>>
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")
>
>
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
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")
Sent from Mail for Windows 10
___
Tutor
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.
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
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
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
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 rivers in rivers.keys():
print (rivers)
#prints country
for rivers in r
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
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.
___
Tutor maillist - Tutor@python.org
To un
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
HI,
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 the text file used to extract the information
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
play with array from #2.
Thanks,
Askar
From: Pinedo, Ruben A [mailto:rapin...@miners.utep.edu]
Sent: Wednesday, October 16, 2013 2:49 PM
To: tutor@python.org
Subject: [Tutor] Help please
I was given this code and I need to modify it so that it will:
#1. Error handling for the files to ensure re
-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
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():
>
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
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
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
#2. Print a range of top words... ex: print top 10-20 words
#3. Print only the words with > 3 characters
#4. Modify the printing function to print top 1 or 2 or 3
#
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
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
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
hon.org
> Subject: Re: [Tutor] HELP Please!!!How Do I Make a Graph Chart
> Generate in Python Based on my Code
> Message-ID:
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
Clearly gmail isn't showing you all the headers. I looked for Alan's
mess
> 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
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
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
x27;s header doesn't have this field:
From ljetibo at gmail.com Mon Sep 23 23:17:00 2013
From: ljetibo at gmail.com (=?ISO-8859-2?Q?Dino_Bekte=B9evi=E6?=)
Date: Mon, 23 Sep 2013 23:17:00 +0200
Subject: [Tutor] HELP Please!!!How Do I Make a Graph Chart Generate
in Pytho
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
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
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
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
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
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
Can anyone please help me figure out what I am NOT doing to make this program
work properly.PLEASE !!
I need to be able to take the user input that is entered in the two graphical
boxes of the first window and evaluate it to generate a graph chart which is
suppose to display in the second
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
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
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
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
Thank you
g.py
Description: Binary data
___
Hi, Cecilia:
I came across your posts when catching up with my tutor-request digest
emails. I did not see the Udacity site mentioned--if it was, my apologies
for the repetition.
Udacity.com, a free online education service, offers a number of
high-quality courses. They include interactive quizzes
On 22/08/12 21:51, Cecilia Chavana-Bryant wrote:
def main(fname, sheet_name):
wb = xlrd.open_workbook(fname)
sh = wb.sheet_by_name(sheet_name)
data1 = sh.col_values(0)
data2 = sh.col_values(1)
return data1, data2
fname = "Cal_File_P17.xlsx"
sheet_name = "RefPanelData"
On 22/08/12 22:51, Cecilia Chavana-Bryant wrote:
Steven, (now from my new account without all the long-winded signature)
can files be attached to posts in this forum?
Yes they can, but we prefer if you just include them in the body if they
are fairly short (<100 lines?) or put them on a pasteb
Steven, (now from my new account without all the long-winded signature) can
files be attached to posts in this forum?
Cecilia
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/t
I highly recommend the Google Python class that is found on YouTube.
The first video is found at http://www.youtube.com/watch?v=tKTZoB2Vjuk
The supporting class materials and assignments are found at
http://code.google.com/edu/languages/google-python-class/ . This series
of videos begins at a pret
Hi Cecilia,
You've had a lot of good replies already, but I'd like to add the
following points if I may:
1) You probably should figure out as much as that's possible up front
exactly you're trying to do in terms of data processing first (e.g.
some idea of the stats, graphs, summaries, operations
On 22/08/12 11:10, Cecilia Chavana-Bryant wrote:
"I do not know how to programme!". Thus, I was hoping that some of you
can remember how you got started and point me towards any really good
interactive learning guides/materials and/or have a good learning
strategy for a complete beginner.
At t
; School of Geography and the Environment
> University of Oxford
> South Parks Road, Oxford, OX1 3QY
> Web: http://www.eci.ox.ac.uk/teaching/doctoral/chavanabryantcecilia.php
> Tel Direct: +44 (0)1865 275861
> Fax: +44 (0)1865 275885
>
> From: William R. Wing (Bil
m R. Wing (Bill Wing) [w...@mac.com]
Sent: 22 August 2012 15:17
To: Cecilia Chavana-Bryant
Cc: William R. Wing (Bill Wing)
Subject: Re: [Tutor] Hello Python Tutor - help please!
On Aug 22, 2012, at 6:10 AM, Cecilia Chavana-Bryant
mailto:cecilia.chavana-bry...@ouce.ox.ac.uk>>
wrote:
Dear al
Hello Cecilia,
My replies are below, interleaved with your comments, which are
prefixed with > marks.
On 22/08/12 20:10, Cecilia Chavana-Bryant wrote:
By the way, the 3 weeks I spent trying to learn C really ended up
being spent trying to get to grips with using a terminal for the
first time
havana-bry...@ouce.ox.ac.uk
To: tutor@python.org
Date: Wed, 22 Aug 2012 10:10:46 +
Subject: [Tutor] Hello Python Tutor - help please!
Dear all,
I am just returning to my doctoral studies after a 7-month medical leave and
desperately trying to catch up for lost time. I am COMPLET
plies.
-Mario
--
From: Cecilia Chavana-Bryant
Sent: 8/22/2012 6:35 AM
To: tutor@python.org
Subject: [Tutor] Hello Python Tutor - help please!
Dear all,
I am just returning to my doctoral studies after a 7-month medical leave
and desperately trying to catch up for lost
Dear all,
I am just returning to my doctoral studies after a 7-month medical leave and
desperately trying to catch up for lost time. I am COMPLETELY new to
programming, well, I did try learning C for 3 weeks 3 yrs ago (with very little
success) but had to stop and then spent 2 years in the Amaz
>> 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.
___
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
> > 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
> 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
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
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()
I understand that line_count counts the number of lines in the Python pro
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
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 and dad are in a good mood, all is good."
print "If one is and one isn
Hi,
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?
Question:
Consider a digraph with 10 vertices, labeled 1 through 10. You are given the
following adjacency list
"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
> 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
Hi,
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?
Question:
Consider a digraph with 10 vertices, labeled 1 through 10. You are given the
following adjacency list
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
>
>
83 matches
Mail list logo