Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Abdur-Rahmaan Janhangeer
XD that will help in the future, yes it was not unreadable this one. Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Steven D'Aprano
On Tue, Feb 26, 2019 at 01:34:33PM -0700, shaef...@q.com wrote: > I am learning python. I wanted to test my ability by making a program to > keep track of the flip of a coin to find how many consecutive times it came > up heads and tails. Here's how to count the number of times it comes up heads

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Alan Gauld via Tutor
On 27/02/2019 09:35, Abdur-Rahmaan Janhangeer wrote: > maybe try dpaste.de or something like that for code pasting ^^_ That can be useful if it's very long code but this is actually quite a short program and it's much easier to reply to if the code is in the message so I think the OP did the right

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-27 Thread Abdur-Rahmaan Janhangeer
maybe try dpaste.de or something like that for code pasting ^^_ Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht

Re: [Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-26 Thread Alan Gauld via Tutor
On 26/02/2019 20:34, shaef...@q.com wrote: > I am learning python. I assume you are coming from some other language? If not you have managed to come up with the most convoluted and un-pythonic way imaginable to do a fairly simple task! > I wanted to test my ability by making a program to > keep

[Tutor] I flip a coin 1 million times what is the consecutive times it will come up head and come up tails

2019-02-26 Thread shaeffer
I am learning python. I wanted to test my ability by making a program to keep track of the flip of a coin to find how many consecutive times it came up heads and tails. Just want some criticism on what I have done. import random Hn = {} Tn = {} for i in range (0,31): va

Re: [Tutor] I need help with my project

2018-12-03 Thread Treyton Hendrix
Awesome! Thanks to your help, I finally got my program done. Click here if you want to see it! > On Fri, Nov 30, 2018 at 5:14 PM Cameron Simpson wrote: > Avi and Alan and Sibylle, you're making this a bit hard on the OP > (Treyton). > > Yes he's supplied no context, but it is easy to make so

Re: [Tutor] I need help with my project

2018-11-30 Thread Cameron Simpson
Avi and Alan and Sibylle, you're making this a bit hard on the OP (Treyton). Yes he's supplied no context, but it is easy to make some suggestions. Each of yours suggests he design a much wider system (menu entry, web interface, some kind of GUI). All of which is (a) beyond him and (b) irrel

Re: [Tutor] I need help with my project

2018-11-28 Thread Avi Gross
us reasons. -Original Message- From: Tutor On Behalf Of Treyton Hendrix Sent: Tuesday, November 27, 2018 7:30 PM To: tutor@python.org Subject: [Tutor] I need help with my project If the user selected a sandwich, french fries, and a beverage, reduce the total cost of the order by $1.00

Re: [Tutor] I need help with my project

2018-11-28 Thread Alan Gauld via Tutor
On 28/11/2018 00:30, Treyton Hendrix wrote: > If the user selected a sandwich, french fries, and a beverage, reduce the > total cost of the order by $1.00. > > This is what I have to do and I don't know where to start. Neither do we because we don't know what you are talking about. There is no co

Re: [Tutor] I need help with my project

2018-11-28 Thread Bob Gailer
On Nov 28, 2018 3:43 AM, "Treyton Hendrix" <2hendri...@stu.bps-ok.org> wrote: > > If the user selected a sandwich, french fries, and a beverage, reduce the > total cost of the order by $1.00. > > This is what I have to do and I don't know where to start. You start by learning how to ask effective

Re: [Tutor] I need help with my project

2018-11-28 Thread Sibylle Koczian
Am 28.11.2018 um 01:30 schrieb Treyton Hendrix: If the user selected a sandwich, french fries, and a beverage, reduce the total cost of the order by $1.00. This is what I have to do and I don't know where to start. Well, you are lucky. I just had my first mind-reading lesson today, you are my

[Tutor] I need help with my project

2018-11-28 Thread Treyton Hendrix
If the user selected a sandwich, french fries, and a beverage, reduce the total cost of the order by $1.00. This is what I have to do and I don't know where to start. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Roger B. Atkins
What about installing or reinstalling Django using the python version that produced the error message? On Mon, Nov 12, 2018 at 10:10 AM Matthew Ngaha wrote: > > On Mon, Nov 12, 2018 at 3:31 PM Mats Wichmann wrote: > > > > Reconstruct the virtualenv you want maybe? Their whole concept is that > >

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 5:52 PM Mats Wichmann wrote: > but the real message is that it couldn't > find necessary Django pieces in the python environment (this is > consistent with your original message, suggesting it found and is > running manage, but other things are missing). > You're right, I w

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 5:35 PM Roger B. Atkins wrote: > > What about installing or reinstalling Django using the python version > that produced the error message? Yeah if all else fails I'll try this. Thanks. ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Mats Wichmann
On 11/12/18 10:07 AM, Matthew Ngaha wrote: > On Mon, Nov 12, 2018 at 3:31 PM Mats Wichmann wrote: >> >> Reconstruct the virtualenv you want maybe? Their whole concept is that >> they're cheap and easy and can just be thrown away. Of course, you then >> have to remember what you did to create it i

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
On Mon, Nov 12, 2018 at 3:31 PM Mats Wichmann wrote: > > Reconstruct the virtualenv you want maybe? Their whole concept is that > they're cheap and easy and can just be thrown away. Of course, you then > have to remember what you did to create it in order to make a new one... It's been 3 years,

Re: [Tutor] I think I've broken my Python

2018-11-12 Thread Mats Wichmann
On 11/12/18 4:45 AM, Matthew Ngaha wrote: > I haven't coded in about 3 years and I used to use Python3.4 on > openSUSE13.1. I had a virtual environment with this Python for a > development Django website. Before I stopped coding, I upgraded to > Python3.5, but everything still worked if I remember

[Tutor] I think I've broken my Python

2018-11-12 Thread Matthew Ngaha
I haven't coded in about 3 years and I used to use Python3.4 on openSUSE13.1. I had a virtual environment with this Python for a development Django website. Before I stopped coding, I upgraded to Python3.5, but everything still worked if I remember correctly. But now I'm back to coding I tried to l

Re: [Tutor] I found the octal and hexadecimal direct conversion method

2018-09-02 Thread Alan Gauld via Tutor
On 02/09/18 14:27, kanzan wrote: > ☻ I found direct method of octal and hexadecimal conversions ☻ (without > using binary or decimal) I'm not sure what you mean but numbertheory has been around for along time and has long had methods to convert from one base to another (not just computer bases but

Re: [Tutor] I get an error while search in my Entry field

2018-06-18 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 17/06/18 23:59, Ali M wrote: > >> def update_list(self): >> search_term = self.search_var.get() >> self.listbox.delete(0, tk.END) >> for item in self.listbox: > > The above pair of lines look odd. > You delete everything on the listbox

Re: [Tutor] I get an error while search in my Entry field

2018-06-18 Thread Alan Gauld via Tutor
On 17/06/18 23:59, Ali M wrote: > def update_list(self): > search_term = self.search_var.get() > self.listbox.delete(0, tk.END) > for item in self.listbox: The above pair of lines look odd. You delete everything on the listbox then try to iterate over it? Is that reall

[Tutor] I get an error while search in my Entry field

2018-06-18 Thread Ali M
Hi, i get an error while searching my Entry field and i don't understand what that means. code: #! /usr/bin/env python3 #GeologyDict by Ali M import sqlite3 as sqlite import tkinter as tk from tkinter import Text from tkinter import Entry from tkinter import Scrollbar from tkinter import ttk #GU

Re: [Tutor] i really need help

2018-05-30 Thread Abdur-Rahmaan Janhangeer
did you attach a screenshot? if so i think it did not reach us ! Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ On Wed, 30 May 2018, 20:11 erich callahana, wrote: > > > I need to know how to access the window where in the menu at the top it > says run and that’s where I can test my

Re: [Tutor] i really need help

2018-05-30 Thread Brian Lockwood
If you only have the command line. Use the command line to navigate the folder where your script is. Then use the command python Followed by your scrutiny On Wed, 30 May 2018 at 17:13, erich callahana wrote: > > > I need to know how to access the window where in the menu at the top it > says r

Re: [Tutor] i really need help

2018-05-30 Thread Alan Gauld via Tutor
On 30/05/18 11:09, erich callahana wrote: > I need to know how to access the window where > in the menu at the top it > says run You need to help us out here. What program are you running or trying to run that has this Window? It sounds like an IDE of some kind, maybe IDLE? But most IDEs have a

[Tutor] i really need help

2018-05-30 Thread erich callahana
I need to know how to access the window where in the menu at the top it says run and that’s where I can test my script, basically I have no idea how to test my script Thankyou Kind Regards Erich.C ___ Tutor maillist - Tutor@python.org To unsubsc

Re: [Tutor] I have a problem with def

2018-02-23 Thread john fabiani
I don't what you are doing but it should be at least def func(): notice the colon at the end. Johnf On 02/22/2018 02:16 PM, David Bauer wrote: it doesn't work, you are suppsed to declare a function as def func() and it comes back as: File "", line 1 def func() ^ SyntaxEr

Re: [Tutor] I have a problem with def

2018-02-23 Thread Bob Gailer
On Feb 23, 2018 3:58 AM, "David Bauer" wrote: > > it doesn't work, you are suppsed to declare a function as def func() and it > comes back as: > > File "", line 1 > def func() > ^ > SyntaxError: invalid syntax > > that is not expected I would also expect def to turn red because it

Re: [Tutor] I have a problem with def

2018-02-23 Thread Mark Lawrence
On 22/02/18 22:16, David Bauer wrote: it doesn't work, you are suppsed to declare a function as def func() and it comes back as: File "", line 1 def func() ^ SyntaxError: invalid syntax that is not expected I would also expect def to turn red because it is a keyword in Python

[Tutor] I have a problem with def

2018-02-23 Thread David Bauer
it doesn't work, you are suppsed to declare a function as def func() and it comes back as: File "", line 1 def func() ^ SyntaxError: invalid syntax that is not expected I would also expect def to turn red because it is a keyword in Python, but that doesn't happen, anyone else hav

[Tutor] I found something nice!

2017-10-20 Thread Michael C
Hi all! My project needs to use MEMORY_BASIC_INFORMATION() and SYSTEM_INFO() structures, and previously I thought there wasn't a way (thanks to ErykSun, who wrote it for me, which I have been using) Now I found out someone actually wrote a long time ago, so all I have to do is to download and ins

Re: [Tutor] I am trying to create a list of object and want to display that list on the screen on my Tkinter screen

2017-10-04 Thread Alan Gauld via Tutor
On 04/10/17 14:40, edmundo pierre via Tutor wrote: > Hello, > I am writing a code When posting code please use plain text. HTML gets mangled so we can't see what your code looks like.(see below) > where I am using a empty list and I will fill up that > list with object. Then  I will show those

[Tutor] I am trying to create a list of object and want to display that list on the screen on my Tkinter screen

2017-10-04 Thread edmundo pierre via Tutor
Hello, I am writing a code where I am using a empty list and I will fill up that list with object. Then  I will show those on my Tkinter screen that I create. But when I run my code ,it crashes. Any help? # Variable   a = Intvar()    a1 = DoubleVar() #Create a function def Answe():      A = a.ge

Re: [Tutor] I want to learn how memory works!

2017-09-29 Thread Alan Gauld via Tutor
On 29/09/17 19:47, Michael C wrote: > Could you point me to a source of information about all the things someone > should know before he starts writing a memory scanner? Not a single source but wikipedia is a good start for anything technical. In particular you need to understand the difference

[Tutor] I want to learn how memory works!

2017-09-29 Thread Michael C
Hi all, after 1 week of on and off hacking, I realized I simply don't know enough about how memory works fundamentally! Could you point me to a source of information about all the things someone should know before he starts writing a memory scanner? Attached is my current code, which doesn't work

Re: [Tutor] I have a problem

2017-09-23 Thread Mats Wichmann
On 09/23/2017 03:46 AM, Sibylle Koczian wrote: > Am 22.09.2017 um 23:41 schrieb Mizav: >> You are using pip version 7.1.2, however version 9.0.1 is available. >> You should consider upgrading via the 'python -m pip install --upgrade >> pip' >> command. >> > > And what is the problem? Did you under

Re: [Tutor] I have a problem

2017-09-23 Thread Sibylle Koczian
Am 22.09.2017 um 23:41 schrieb Mizav: You are using pip version 7.1.2, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. And what is the problem? Did you understand the message? Did you try to do the upgrade and what happe

[Tutor] I have a problem

2017-09-23 Thread Mizav
You are using pip version 7.1.2, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.p

Re: [Tutor] I can not display the answer of the Limit when I click the Button Answer.

2017-09-13 Thread Mats Wichmann
On 09/13/2017 09:03 AM, edmundo pierre via Tutor wrote: >                                                            That is my code > below. I used tkinter to calculate the limit of a function. I used Grid > geometry, but when I click the button Answer, but nothing comes out so I do > not know

[Tutor] I can not display the answer of the Limit when I click the Button Answer.

2017-09-13 Thread edmundo pierre via Tutor
                                                           That is my code below. I used tkinter to calculate the limit of a function. I used Grid geometry, but when I click the button Answer, but nothing comes out so I do not know where I am doing wrong. I hope my code will be visible, I have t

Re: [Tutor] I want to display Integral symbols

2017-09-05 Thread Alan Gauld via Tutor
On 05/09/17 14:29, edmundo pierre via Tutor wrote: > I have been trying to display mathematics symbols on my Tkinter (using > Python) project, > but was not successful So show us what you did. Its hard to figure out what's gone wrong when we can't see your code. And that includes telling us wh

[Tutor] I want to display Integral symbols

2017-09-05 Thread edmundo pierre via Tutor
I have been trying to display mathematics symbols on my Tkinter (using Python) project, but was not successful .I am trying  to compute integrals on my Tkinter project and will like to display this image on my tkinter:∫2xdx. Jupiter can display that symbol using sympy, but I can not dis

Re: [Tutor] I hope you can build a platform for studying in Traditional Chinese.Please

2017-01-29 Thread boB Stepp
Hello! On Sun, Jan 29, 2017 at 12:31 PM, 劉權陞 <01patrick...@gmail.com> wrote: > Hello: I am the student in junior high school.I would like to learn python, > but there are few traditional Chinese resources on the website, especially > the Python's documents are all in English I can not read it.( >

[Tutor] I hope you can build a platform for studying in Traditional Chinese.Please

2017-01-29 Thread 劉權陞
Hello: I am the student in junior high school.I would like to learn python, but there are few traditional Chinese resources on the website, especially the Python's documents are all in English I can not read it.( https://docs.python.org/2/) I hope you can build a platform for studying in Traditiona

Re: [Tutor] I download package and it says computer is missing this file, how do I fix?

2016-12-23 Thread Alan Gauld via Tutor
On 23/12/16 01:47, Don Pryor wrote: > [image: Inline image 1] > This is a text mailing list so the server strips out most attachments. You need to tell us a lot more. 1) What package are you trying to install 2) How are you downloading/installing it(pip/ftp/binary installer?) 3) Which OS and Pytho

[Tutor] I download package and it says computer is missing this file, how do I fix?

2016-12-23 Thread Don Pryor
[image: Inline image 1] -- Donald E. Pryor *7GTSeventh Generation Technologies L.L.C. * *Email*: donpryor...@gmail.com *Cell*: 330-554-8650 *NOTICE:* This message and any attached files are intended only for the use of the addressee indicated above & are protected products either patented,

Re: [Tutor] I Need Help

2016-08-24 Thread Steven D'Aprano
On Wed, Aug 24, 2016 at 11:26:07AM +0100, Micheal Emeagi wrote: > yt = [1,2,3,4,5,6] > ft = [yt[0],yt[0]] > alpha = 0.5 > while len(ft) != len(yt) + 1: > ft.append(ft[1] + alpha * (yt[1] - ft[1])) > print(ft) > ft[1] += 1 > yt[1] += 1 > > print (ft) I think that your intention is

Re: [Tutor] I Need Help

2016-08-24 Thread Alan Gauld via Tutor
On 24/08/16 19:12, Micheal Emeagi wrote: > This is what it is suppose to be > [1, 1, 1.5, 2.25, 3.125, 4.06, 5.03] Oh good, it looks like my wild guess was right. :-) enjoy, -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow

Re: [Tutor] I Need Help

2016-08-24 Thread Micheal Emeagi
This is what it is suppose to be [1, 1, 1.5] [1, 1, 1.5, 2.25] [1, 1, 1.5, 2.25, 3.125] [1, 1, 1.5, 2.25, 3.125, 4.06] [1, 1, 1.5, 2.25, 3.125, 4.06, 5.03] The model below is what I want to implement.I chose alpha to be 0.5. The model below chose 0.3. What is Exponential Smoothing? - A typ

Re: [Tutor] I Need Help

2016-08-24 Thread Joaquin Alzola
>I want the elements of ft to increment by one while I use it to generate the >subsequent element. But for some reasons I don't understand, it keeps changing >the second element in Ft. >yt = [1,2,3,4,5,6] >ft = [yt[0],yt[0]] >alpha = 0.5 >while len(ft) != len(yt) + 1: >ft.append(ft[1] + al

Re: [Tutor] I Need Help

2016-08-24 Thread Alan Gauld via Tutor
On 24/08/16 11:26, Micheal Emeagi wrote: > forcast values. Ft is the forcast list whose length should be one element > greater than the Yt list. I want the elements of ft to increment by one > while I use it to generate the subsequent element. But for some reasons I > don't understand, it keeps ch

[Tutor] I Need Help

2016-08-24 Thread Micheal Emeagi
Hello Tutor, I am a newbie programmer trying to implement an exponential smoothing forcast using two list. Yt list has the Y values and Ft list has the forcast values. Ft is the forcast list whose length should be one element greater than the Yt list. I want the elements of ft to increment by

Re: [Tutor] I want to share a source that i wrote

2016-01-15 Thread Alan Gauld
On 15/01/16 01:11, Ricardo Martínez wrote: > Hi guys, i wrote a simply MySQL interpretar with Python / Tk and I want to > ask if can I share with the people in the list to discuss about the code > and maybe help to the community. > > The source code has 200 lines and is written in a single file.

[Tutor] I want to share a source that i wrote

2016-01-15 Thread Ricardo Martínez
Hi guys, i wrote a simply MySQL interpretar with Python / Tk and I want to ask if can I share with the people in the list to discuss about the code and maybe help to the community. The source code has 200 lines and is written in a single file. P.D. please, Alan Gauld be kind with my mistakes abou

Re: [Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-17 Thread Bob Gailer
Also: Briefly describe problem 22 Show us what you did to test the program It would be better to test for integer before doing a numeric comparison There is no need ever to compare a boolean expression to true or false. All you need is either if condition or if not condition. A good short cut for a

Re: [Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-16 Thread Alan Gauld
On 16/10/15 23:31, zak nelson wrote: I don't understand why this program is said to be "not defined" when I test it. In future please be more precise in describing the problem, and that means including the full error message in the post. It contains a lot of useful information. I'm guessing it

[Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-16 Thread zak nelson
I don't understand why this program is said to be "not defined" when I test it. def problem22(aList): length=len(aList) if (length>6): bueler=False else: bueler=True for i in aList: if(i < 0 and i > 6)==False: bueler=False

Re: [Tutor] I need help with my homework. No, really....

2015-07-29 Thread Steven D'Aprano
Part 3... On Wed, Jul 29, 2015 at 04:16:58AM -0500, Lissa Hopson wrote: > following: > > 1. Load array x column-wise and array y row-wise > 2. Multiply x by y to compute array z > 3. Compute the sum of all elements in column 2 of array x and add it to the > sum of all elements in row 2 of y (the

Re: [Tutor] I need help with my homework. No, really....

2015-07-29 Thread Steven D'Aprano
Part 2... On Wed, Jul 29, 2015 at 04:16:58AM -0500, Lissa Hopson wrote: > Given x as an array of [5,3] and y as an array of [3,7] perform the > following: > > 1. Load array x column-wise and array y row-wise > 2. Multiply x by y to compute array z > 3. Compute the sum of all elements in column 2

Re: [Tutor] I need help with my homework. No, really....

2015-07-29 Thread Steven D'Aprano
On Wed, Jul 29, 2015 at 04:16:58AM -0500, Lissa Hopson wrote: > I'm taking a beginning Python course at Austin Community College. I'm also > taking two other project-based web programming courses. It's summer > semester, meaning we have eight weeks instead of the usual 16 to finish all > the requir

[Tutor] I need help with my homework. No, really....

2015-07-29 Thread Lissa Hopson
I'm taking a beginning Python course at Austin Community College. I'm also taking two other project-based web programming courses. It's summer semester, meaning we have eight weeks instead of the usual 16 to finish all the requirements. The semester ends Friday, July 131st. Yes, I am aware that I'm

Re: [Tutor] I am trying to get my encryption program to print from my def main. I am just learning the program.

2015-05-01 Thread Alan Gauld
On 01/05/15 11:48, Corneil Lionel wrote: text_list=[] temp=[] import allison import corneil def main(): choice=input("Would you like to begin? y/n: ") while choice!='n': d=cipher() alphabet=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V

[Tutor] I am trying to get my encryption program to print from my def main. I am just learning the program.

2015-05-01 Thread Corneil Lionel
text_list=[] temp=[] import allison import corneil def main(): choice=input("Would you like to begin? y/n: ") while choice!='n': d=cipher() alphabet=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] print('Would you li

Re: [Tutor] I apologize

2014-11-16 Thread Alan Gauld
On 16/11/14 04:06, Crush wrote: Below was the post that was sent from the wrong email. Not sure if the first post went through, so in the event it did not, I will post again; if it was posted twice, I apologize for the redundancy. The original got through without appearing in the moderation que

Re: [Tutor] I apologize

2014-11-15 Thread Crush
Below was the post that was sent from the wrong email. Not sure if the first post went through, so in the event it did not, I will post again; if it was posted twice, I apologize for the redundancy. Subject: Re: Help understanding classes Thank you Alan and Danny. It amazes me at the lengths y

[Tutor] I apologize

2014-11-15 Thread Bo
I accidentally sent my last email from my work email. I recently added my gmail account to MS exchange and I forget I have to change where I send the mail from now that I have two accounts in exchange. Sorry for any confusion. ___ Tutor maillist - Tut

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread wesley chun
I'm not going to add too much more to all the replies here already, but one of my students did record a quick <6-minute video in one of my courses where i explained generators. hopefully you find it useful! It's about halfway down the page at http://cyberwebconsulting.com. (Also for those learning

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Hilton Fernandes
Dear all, i'd like to thank every answer in this list. Alan Gauld is a fine writer of excellent introductory material on Pyton, and so are a few other members of this list. So, it is always enlightening to read what you all write. Keep up the good work. All the best, hilton On Wed, May 28, 20

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Alan Gauld
On 28/05/14 11:52, Degreat Yartey wrote: This means that '...' should generally contain a manipulator then yield generates from where it stopped...*getting it* It would help if you deleted the irrelevent bits so we can see which '...' you mean. I'm guessing it was this comment, right at the

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
This means that '...' should generally contain a manipulator then yield generates from where it stopped...*getting it* Thanks for the explanation though! Its seems so simple to digest. Thank you... On May 28, 2014 1:09 AM, "Danny Yoo" wrote: > On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey >

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
I am completely new to programming! On May 27, 2014 10:54 PM, "R. Alan Monroe" wrote: > > I need an explanation so simple as using the expression 'print ()', in > this case 'yield'. > > Python 2.6 here! > > Ever write any C programs with static variables? Generators can be > explained in those te

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Degreat Yartey
I really love this explanation... that means functions just run till it finishes its duty, then return...and generators just generate one at a time until the 'for' statement asks for __next__(). On May 28, 2014 8:37 AM, "Cameron Simpson" wrote: > On 27May2014 15:27, Degreat Yartey wrote: > >> I

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-28 Thread Cameron Simpson
On 27May2014 15:27, Degreat Yartey wrote: I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as using the expression 'print ()', in this case

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Marc Tompkins
On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey wrote: > I am studying python on my own (i.e. i am between the beginner and > intermediate level) and i haven't met any difficulty until i reached the > topic 'Generators and Iterators'. > I need an explanation so simple as using the expression 'pri

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Danny Yoo
On Tue, May 27, 2014 at 12:27 PM, Degreat Yartey wrote: > I am studying python on my own (i.e. i am between the beginner and > intermediate level) and i haven't met any difficulty until i reached the > topic 'Generators and Iterators'. > I need an explanation so simple as using the expression 'pri

Re: [Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread R. Alan Monroe
> I need an explanation so simple as using the expression 'print ()', in this > case 'yield'. > Python 2.6 here! Ever write any C programs with static variables? Generators can be explained in those terms if you have experience with them. Alan ___ Tut

[Tutor] I am having difficulty grasping 'generators'

2014-05-27 Thread Degreat Yartey
I am studying python on my own (i.e. i am between the beginner and intermediate level) and i haven't met any difficulty until i reached the topic 'Generators and Iterators'. I need an explanation so simple as using the expression 'print ()', in this case 'yield'. Python 2.6 here! Thank you. ___

Re: [Tutor] i dont understand this code

2014-02-24 Thread Danny Yoo
It's also a bit unreasonable to ask us to reverse-engineer code that is orginally CRC-16 code. Whoever you got this code from is violating the GPL by stripping out the comments or the COPYRIGHT license from the original sources. This is perhaps unintentional. Please ask them to correct the probl

Re: [Tutor] I can't understand where python class methods come from

2014-02-24 Thread voger
Thank you all for your responses. My first post on the list an I already got more than I asked for. :) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] I can't understand where python class methods come from

2014-02-24 Thread spir
On 02/23/2014 10:59 PM, voger wrote: I have a really hard time understanding where methods are defined in python classes. My first contact with programming was with C++ and Java and even if I was messing with them in a very amateurish level, I could find where each class was defined and what meth

Re: [Tutor] I can't understand where python class methods come from

2014-02-23 Thread James Scholes
voger wrote: > Some properties I can see them defined but some others like > sublocality or administrative_area_level_1 I don't see them defined > anywhere. Also in the comments in the source code the author says > > #You can also choose a different property to display for each lookup > #type. #

Re: [Tutor] I can't understand where python class methods come from

2014-02-23 Thread Alan Gauld
On 23/02/14 21:59, voger wrote: I have a really hard time understanding where methods are defined in python classes. My first contact with programming was with C++ and Java Ben has already addressed much of your confusion. I'd just add that if you look at C++ operator overloading it is very si

Re: [Tutor] I can't understand where python class methods come from

2014-02-23 Thread Ben Finney
voger writes: > I have a really hard time understanding where methods are defined in > python classes. Reading the rest of your message, I think you're saying that you can't locate *which* class defines a method > […] With python everything looks like magic. It can seem that way. Fortunately,

[Tutor] I can't understand where python class methods come from

2014-02-23 Thread voger
I have a really hard time understanding where methods are defined in python classes. My first contact with programming was with C++ and Java and even if I was messing with them in a very amateurish level, I could find where each class was defined and what methods were defined inside them. Everyt

Re: [Tutor] i dont understand this code

2014-02-22 Thread Alan Gauld
On 22/02/14 12:26, piyush joshi wrote: Can anyone help me out in understanding this code Sure, but it's an quite a lot of code to describe line by line. Is there anything specific you need help with? import os rotationMatrix1 = [7, 1, 5, 3, 0, 6, 2, 5, 2, 3, 0, 6, 1, 7, 6, 1, 5, 2, 7, 1, 0,

Re: [Tutor] i dont understand this code

2014-02-22 Thread bob gailer
On 2/22/2014 7:26 AM, piyush joshi wrote: Can anyone help me out in understanding this code Your question is kinda vague. Exactly what do you not understand? # import os rotationMatrix1 = [7, 1, 5, 3, 0, 6, 2, 5, 2, 3, 0, 6, 1, 7, 6, 1, 5, 2, 7, 1, 0, 3, 7, 6, 1, 0, 5, 2, 1, 5, 7, 3, 2, 0

[Tutor] i dont understand this code

2014-02-22 Thread piyush joshi
Can anyone help me out in understanding this code # import os rotationMatrix1 = [7, 1, 5, 3, 0, 6, 2, 5, 2, 3, 0, 6, 1, 7, 6, 1, 5, 2, 7, 1, 0, 3, 7, 6, 1, 0, 5, 2, 1, 5, 7, 3, 2, 0, 6] rotationMatrix2 = [1, 6, 2, 5, 7, 3, 0, 7, 1, 6, 2, 5, 0, 3, 0, 6, 5, 1, 1, 7, 2, 5, 2, 3, 7, 6, 2,

Re: [Tutor] I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exerci

2014-02-04 Thread Danny Yoo
On Tue, Feb 4, 2014 at 11:31 AM, Thomas Maher wrote: > Thank you for helping me. I used a similar code, but with an if statement. > if list1 in list2: > return len(list2[-1]) > > This is the code they sent me this morning. > > def len_of_innerlist(list2): > for ele in list2: > if isinstance(e

Re: [Tutor] I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exerci

2014-02-04 Thread Danny Yoo
The question as stated is fairly artificial and a bit nonsensical. Let me explain that statement, because it's a strong one. If we know the exact shape for list1 and list2 are, we can answer this question directly, without loops. len(list1[-1]) "Take the last element of the list1, and grab i

Re: [Tutor] I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exerci

2014-02-04 Thread Peter Otten
Thomas Maher wrote: > I am teaching my students Python the second semester using > www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some > help. I am having a problem with the Lists-Set 1 exercise 18. The > problem is below. I have put in several codes and the output is 5,

[Tutor] I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exercise 1

2014-02-04 Thread Thomas Maher
I am teaching my students Python the second semester using www.LearnStreet.com ( http://www.learnstreet.com/ ). I am in need of some help. I am having a problem with the Lists-Set 1 exercise 18. The problem is below. I have put in several codes and the output is 5, which is the right answer.

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Don Jennings
On Dec 16, 2013, at 11:56 AM, eva maria gualandi wrote: > Good afternoon, > I installed from https://pypi.python.org/pypi/statsmodels the package > statsmodels for python 2.7 (32bit) , i have to do some test statistics for a > time series analysis that i can find under statsmodels.tsa. In part

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Derry, James R
13 10:56 AM To: tutor@python.org Subject: [Tutor] i installed the package statsmodels but i get an error when i use it Good afternoon, I installed from https://pypi.python.org/pypi/statsmodels the package statsmodels for python 2.7 (32bit) , i have to do some test statistics for a ti

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Alan Gauld
On 16/12/13 16:56, eva maria gualandi wrote: ) i run this simple programm import numpy as np import statsmodels from statsmodels.tsa import stattools x = np.array([1,2,3,4,3,4,2,3]) result = statsmodels.tsa.statools.adfuller(x,1) Since you explicitly imported stattools you only need to cal

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Steven D'Aprano
Hello Eva, On Mon, Dec 16, 2013 at 05:56:36PM +0100, eva maria gualandi wrote: [...] > but unfortunately i get the following error message: > > Traceback (most recent call last): > File "C:\Python27\esempio_adftest.py", line 3, in > from statsmodels.tsa import stattools [...] > from pa

[Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread eva maria gualandi
Good afternoon, I installed from *https://pypi.python.org/pypi/statsmodels *the package statsmodels for python 2.7 (32bit) , i have to do some test statistics for a time series analysis that i can find under statsmodels.tsa. In particular i really need to

Re: [Tutor] I need help with the following question

2013-09-10 Thread Dino Bektešević
> Message: 3 > Date: Tue, 10 Sep 2013 09:58:31 +0200 > From: Thabile Rampa > To: tutor@python.org > Subject: [Tutor] [Re:] I need help with the following question > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > On Aug 27, 2013, at 3:40 AM, isaac Eric wrote > > > > pr

Re: [Tutor] i need help with the following question

2013-08-27 Thread Don Jennings
On Aug 27, 2013, at 3:40 AM, isaac Eric wrote: > print "For a circle of radius %s the area is %s" % (radius,area) > Question: What is the purpose of %s ? Okay, so you're just getting started with python. We're happy to do some hand-holding, but we encourage you to think first. You've follow

  1   2   3   4   5   >