Re: [Tutor] Help

2015-03-07 Thread Alan Gauld
On 07/03/15 15:39, elie khairallah wrote: hello , I would like to know if theres a way to change a variable's name after every iteration for example I want to make a function that stores a number in x_1 if i=1 and in x_2 if i=2. To be more precise: i=1 def f(n): while i Others have alrea

Re: [Tutor] Help

2015-03-07 Thread Danny Yoo
> You could certainly use I as an index into a list called x. This > doesn't look like a good idea though Can you explain more what's problematic with a list? My best understanding so far of the problem is that the original questioner is trying to compute a tabulation of results. For example,

Re: [Tutor] Help

2015-03-07 Thread Danny Yoo
On Sat, Mar 7, 2015 at 7:39 AM, elie khairallah wrote: > hello , I would like to know if theres a way to change a variable's name > after every iteration for example I want to make a function that stores a > number in x_1 if i=1 and in x_2 if i=2. Conceptually, I think you're looking for a list.

Re: [Tutor] Help

2015-03-07 Thread Joel Goldstick
On Sat, Mar 7, 2015 at 1:28 PM, Danny Yoo wrote: >> You could certainly use I as an index into a list called x. This >> doesn't look like a good idea though > > > Can you explain more what's problematic with a list? > > My best understanding so far of the problem is that the original > questioner

Re: [Tutor] Help

2015-03-07 Thread Joel Goldstick
On Sat, Mar 7, 2015 at 10:39 AM, elie khairallah wrote: > hello , I would like to know if theres a way to change a variable's name > after every iteration for example I want to make a function that stores a > number in x_1 if i=1 and in x_2 if i=2. > To be more precise: > i=1 > def f(n): >

[Tutor] Help

2015-03-07 Thread elie khairallah
hello , I would like to know if theres a way to change a variable's name after every iteration for example I want to make a function that stores a number in x_1 if i=1 and in x_2 if i=2. To be more precise: i=1 def f(n): while ihttps://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Cameron Simpson
On 27Feb2015 02:16, Barbara Heliodora G. Rodrigues wrote: I'd like to ask for help with an issue I have with python. My MAC is with OS 10-6.8, darwin kernel, 64 bits. For some reason I updated macports and it automatically updated python to 2.7 with a 32 bits library, and it is giving me lot

Re: [Tutor] Help with python in MAC OS 10.6

2015-02-27 Thread Alan Gauld
On 27/02/15 02:16, Barbara Heliodora G. Rodrigues wrote: Dear tutor, I'd like to ask for help with an issue I have with python. My MAC is with OS 10-6.8, I'm not a MacOs expert but I know MacOS uses Python in some of its tools so do not mess with the standard version, you might break somethin

[Tutor] Help with python in MAC OS 10.6

2015-02-26 Thread Barbara Heliodora G. Rodrigues
Dear tutor, I'd like to ask for help with an issue I have with python. My MAC is with OS 10-6.8, darwin kernel, 64 bits. For some reason I updated macports and it automatically updated python to 2.7 with a 32 bits library, and it is giving me lots of trouble. I can't install any new software tha

Re: [Tutor] Help with program

2015-02-16 Thread Dave Angel
On 02/16/2015 11:27 AM, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine - this is my program so far. It is not returning the right values. Could you tell me what I am doing wrong? You've got several answers that point out several problems

Re: [Tutor] Help with program

2015-02-16 Thread Peter Otten
Courtney Skinner wrote: > Hello, > > I am trying to build a program that approximates the value of cosine - > this is my program so far. It is not returning the right values. Could you > tell me what I am doing wrong? > > > def main(): > > import math > > print("This program appro

Re: [Tutor] Help with program

2015-02-16 Thread Alan Gauld
On 16/02/15 16:27, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine def main(): import math Its usual to do the imports outside the function at the tyop of the file. Python doesn't actually care much but its 'standard practice'.

Re: [Tutor] Help with program

2015-02-16 Thread Mark Lawrence
On 16/02/2015 16:27, Courtney Skinner wrote: Hello, I am trying to build a program that approximates the value of cosine - this is my program so far. It is not returning the right values. Could you tell me what I am doing wrong? def main(): import math Not that it matters but imports

[Tutor] Help with program

2015-02-16 Thread Courtney Skinner
Hello, I am trying to build a program that approximates the value of cosine - this is my program so far. It is not returning the right values. Could you tell me what I am doing wrong? def main(): import math print("This program approximates the cosine of x by summing") print(

Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread Alan Gauld
On 31/12/14 13:49, Tammy Miller wrote: I need help on the following: I have a created a project from a csv file to calculate the mean and standard deviation. I assume that means you read the data from the CSV file and display the stats? However, I would like to create a drop-down list and d

Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread WolfRage
What is the user interface that your program is using, currently? IE: QT, GTK, Tkinter, Curses, Kivy, Pygame, Or None? What is the target system on which your program runs? How are you currently viewing the mean and standard deviation results? What version of Python are you using and what is your

[Tutor] Help on Python drop-down list options

2014-12-31 Thread Tammy Miller
Hello All, I need help on the following: I have a created a project from a csv file to calculate the mean and standard deviation. However, I would like to create a drop-down list and display the mean and standard deviation? Is there a module for that? Thank you, Tammy

Re: [Tutor] help with tic-tac-toe program

2014-11-18 Thread Jan Erik Moström
If I understand what you're asking you need to write the current gameboard and the info you get in 'gameBoard' is the current state of the game. There are several ways of doing this (with different degrees of cleverness) but to keep it simple: Start by printing out the current state, different wa

Re: [Tutor] help with tic-tac-toe program

2014-11-16 Thread Joel Goldstick
On Sun, Nov 16, 2014 at 1:52 PM, Andrew McReynolds wrote: > The section of the assignment that I'm working on states: > 2) Write a function called loadGameBoard (player_marks) where player_marks > is a dictionary that > contains the players’ marks. This function creates a 3x3 array with the > play

[Tutor] help with tic-tac-toe program

2014-11-16 Thread Andrew McReynolds
The section of the assignment that I'm working on states: 2) Write a function called loadGameBoard (player_marks) where player_marks is a dictionary that  contains the players’ marks. This function creates a 3x3 array with the players’ marks populated in the correct row/column indices using the f

Re: [Tutor] Help understanding classes

2014-11-15 Thread Steven D'Aprano
On Sat, Nov 15, 2014 at 06:19:56PM +, Bo Morris wrote: > Thank you Alan and Danny. It amazes me at the lengths you guys, as well as > everyone else who contributes, will go to to help explain things to us; it > is greatly appreciated! > > Alan, I decided to dumb down the learning classes ju

Re: [Tutor] Help understanding classes

2014-11-15 Thread Alan Gauld
On 15/11/14 18:19, Bo Morris wrote: With the first part… class Message: def __init__(self, aString): self.text = aString Will I always use “_init_” when defining the first function in a class? It can go anywhere in the class definition. it is just another method of the class. Bu

Re: [Tutor] Help understanding classes

2014-11-15 Thread Bo Morris
Thank you Alan and Danny. It amazes me at the lengths you guys, as well as everyone else who contributes, will go to to help explain things to us; it is greatly appreciated! Alan, I decided to dumb down the learning classes just a little. By this I mean, I am not using Tkinter to learn classes

Re: [Tutor] Help understanding classes

2014-11-14 Thread Danny Yoo
On Fri, Nov 14, 2014 at 4:29 PM, Bo wrote: > Hello everyone, hope all is well. Was just wondering if I could get some > help understanding classes and how they work. What is the point in OOP if I > don’t understand classes, are classes not the heart and soul of OOP? I have > been trying to learn c

Re: [Tutor] Help understanding classes

2014-11-14 Thread Alan Gauld
On 15/11/14 00:29, Bo wrote: help understanding classes and how they work. What is the point in OOP if I don’t understand classes, are classes not the heart and soul of OOP? Actually not necessarily. There are OOP languages where classes are not included or little used. Javascript is a good exa

[Tutor] Help understanding classes

2014-11-14 Thread Bo
Hello everyone, hope all is well. Was just wondering if I could get some help understanding classes and how they work. What is the point in OOP if I don¹t understand classes, are classes not the heart and soul of OOP? I have been trying to learn classes by practicing with Tkinter building GUIs. Bel

Re: [Tutor] Help with Dice game

2014-11-11 Thread Dave Angel
Wrote in message: > > > > > > > Hello, I can not for the life of me figure out where I have gone wrong. I > wrote the following code as a simulation for the table top game x-wing. It > basically simulates dice rolls but the issue is the fact that every time I > choose a number of dice t

Re: [Tutor] Help with Dice game

2014-11-10 Thread Lifeng Lin
I am not familiar with the game, but maybe using "offense += 1" and "defense += 1" to replace the corresponding "continue" would help? On Mon, Nov 10, 2014 at 2:57 PM, wrote: > Hello, I can not for the life of me figure out where I have gone wrong. > I wrote the following code as a simulation f

Re: [Tutor] Help with Dice game

2014-11-10 Thread Alan Gauld
On 10/11/14 20:57, corylog...@yahoo.com.dmarc.invalid wrote: I wrote the following code as a simulation for the table top game x-wing. I don;t know it so can only give some general comments below... import random print("X-wing dice simulator") x = int(input("How many dice will the offensive

[Tutor] Help with Dice game

2014-11-10 Thread coryloghry
Hello, I can not for the life of me figure out where I have gone wrong. I wrote the following code as a simulation for the table top game x-wing. It basically simulates dice rolls but the issue is the fact that every time I choose a number of dice to roll, they all hit. None of them ever miss

Re: [Tutor] Help with running an API

2014-10-26 Thread Anish Tambe
The usage of the api as documented here - https://github.com/zachwill/fred - suggests : >>> import fred # Save your FRED API key. >>> fred.key('my_fred_api_key') # Interact with economic data categories. >>> fred.category() ... Cheers, Anish Tambe On 26 Oct 2014 00:23, "Joel Goldstick" wrote:

Re: [Tutor] Help with running an API

2014-10-25 Thread Joel Goldstick
On Sat, Oct 25, 2014 at 12:08 PM, Mark Meanwell wrote: > Hi Folks - new to python and trying to run an API. Running version 2.7.3. on > Windows 7 machine. > > Here is the scenario for the given API (FRED API in this case): > > easy_install Fred from C:\ - this installs to C:\site packages > > the

Re: [Tutor] Help with running an API

2014-10-25 Thread Alan Gauld
On 25/10/14 17:08, Mark Meanwell wrote: Hi Folks - new to python and trying to run an API. Running version 2.7.3. on Windows 7 machine. Here is the scenario for the given API (FRED API in this case): easy_install Fred from C:\ - this installs to C:\site packages then I fire up the python she

[Tutor] Help with running an API

2014-10-25 Thread Mark Meanwell
Hi Folks - new to python and trying to run an API. Running version 2.7.3. on Windows 7 machine. Here is the scenario for the given API (FRED API in this case): easy_install Fred from C:\ - this installs to C:\site packages then I fire up the python shell and run file created for fred api: from

Re: [Tutor] Help with guess my number game

2014-10-13 Thread Alan Gauld
On 13/10/14 11:40, אופיר לירון wrote: # set the initial values the_number = random.randint(1, 100) guess = int(input("Take a guess: ")) tries = 1 # guessing loop while guess != the_number: if guess > the_number: print("Lower...") else: print("Higher...") guess

Re: [Tutor] Help with guess my number game

2014-10-13 Thread Danny Yoo
> > if guess != the_number: > > print ("you failed, the number was", the_number) > > elif guess==the_number: > > print("You guessed it! The number was", the_number) > > print("And it only took you", tries, "tries!\n") This block of code appears to be applied for e

[Tutor] Help with guess my number game

2014-10-13 Thread אופיר לירון
Hi,I am new into Python, and using the bookPython Programming for the Absolute Beginner by Michael Dawson.One of the taks in chapte 3 is to change the "guess my number game" to include only 5 gusses and give appropriate messege at the end (in case no sucssesful guess was done).I have tried to add b

Re: [Tutor] Help

2014-09-20 Thread diliup gabadamudalige
http://cscircles.cemc.uwaterloo.ca/run-at-home/ On Fri, Sep 19, 2014 at 11:04 AM, Danny Yoo wrote: > On Wed, Sep 17, 2014 at 4:36 PM, Art Pelletier wrote: > > > > I am a beginner with pythons programming I would like to see if their > is a site that has samples programs that I can practice on

Re: [Tutor] Help

2014-09-18 Thread Danny Yoo
On Wed, Sep 17, 2014 at 4:36 PM, Art Pelletier wrote: > > I am a beginner with pythons programming I would like to see if their is a > site that has samples programs that I can practice on. Hi Art, Yes, there are some good resources you can check out. Here's a link to some of them: htt

Re: [Tutor] Help

2014-09-18 Thread C Smith
Check this guy's youtube channel. He has very basic examples. His username is thenewboston On Wed, Sep 17, 2014 at 4:36 PM, Art Pelletier wrote: > > I am a beginner with pythons programming I would like to see if their is a > site that has samples programs that I can practice on. > Sent from m

[Tutor] Help

2014-09-18 Thread Art Pelletier
I am a beginner with pythons programming I would like to see if their is a site that has samples programs that I can practice on. Sent from my iPad ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.py

Re: [Tutor] Help on best way to check resence of item inside list

2014-05-27 Thread Peter Otten
jarod...@libero.it wrote: > Dear All > > clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra"," > electra"] > clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia", > "sally"," Castiel","Sam"] > > I have a list of names that I would to annotate in function of pr

Re: [Tutor] Help on best way to check resence of item inside list

2014-05-27 Thread Steven D'Aprano
On Tue, May 27, 2014 at 10:05:30AM +0200, jarod...@libero.it wrote: [...] > with open("file.in") as p: > mit = [] You have lost the indentation, which makes this code incorrect. But the rest of the code is too complicated. > for i in p: >lines =i.strip("\n").split("\t") >if (lines[0] in

Re: [Tutor] Help on best way to check resence of item inside list

2014-05-27 Thread Dave Angel
"jarod...@libero.it" Wrote in message: > Dear All > > clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra"," > electra"] > clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia", "sally"," > Castiel","Sam"] > > I have a list of names that I would to annotate in f

Re: [Tutor] Help on best way to check resence of item inside list

2014-05-27 Thread Mark Lawrence
On 27/05/2014 09:05, jarod...@libero.it wrote: Dear All clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra"," electra"] clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia", "sally"," Castiel","Sam"] I have a list of names that I would to annotate in function

[Tutor] Help on best way to check resence of item inside list

2014-05-27 Thread jarod...@libero.it
Dear All clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra"," electra"] clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia", "sally"," Castiel","Sam"] I have a list of names that I would to annotate in function of presence in different clubs: my input files

Re: [Tutor] Help with Python

2014-05-16 Thread Steven D'Aprano
Hi Glen, and welcome! My responses below. On Thu, May 15, 2014 at 09:58:07PM -0400, Glen Chan wrote: > Hello, I am student trying to fugure out why when I enter any number > it says error. It's only suppose to do that if it's out the 1-10 > range. Please help. Thank you. You've made an mistake

Re: [Tutor] Help with Python

2014-05-16 Thread Alan Gauld
On 16/05/14 02:58, Glen Chan wrote: Hello, I am student trying to fugure out why when I enter any number it says error. Because that's what you programmed it to do. Almost. If you enter 1 or 10 you won't get an error. Look at your logic: number = input('Enter a number between 1 and 10: ') wh

[Tutor] Help with Python

2014-05-16 Thread Glen Chan
Hello, I am student trying to fugure out why when I enter any number it says error. It's only suppose to do that if it's out the 1-10 range. Please help. Thank you. number = input('Enter a number between 1 and 10: ') while number < 1 or number > 10: print 'Please enter a number between 1

Re: [Tutor] Help with Python

2014-05-12 Thread jitendra gupta
Hi This will solve your purpose: Yes we can write in better way also : -- #The Dice Game #add libraries needed import random #the main function def main(): print #initialize variables playerOne = 'No Name' playerTwo = 'No Name' endProgram ="no"

Re: [Tutor] Help with Python

2014-05-11 Thread Dave Angel
On 05/10/2014 11:16 PM, Glen Chan wrote: Hello, I am a student trying to figure out Python. I am getting errors that I don't know how to fix. What do you do after you get the error message and something is highlighted? Does that have to be deleted? Anyway, here is what I mean... def main():

Re: [Tutor] Help with Python

2014-05-11 Thread Alan Gauld
On 11/05/14 04:16, Glen Chan wrote: Hello, I am a student trying to figure out Python. I am getting errors that I don't know how to fix. What do you do after you get the error message and something is highlighted? Does that have to be deleted? The error doesn't need to be deleted because it app

Re: [Tutor] Help with Python

2014-05-11 Thread C Smith
Hey Glen, include the error you are getting. It will make answering your question easier. How are you running this program, in an IDE? On Sat, May 10, 2014 at 11:16 PM, Glen Chan wrote: > Hello, I am a student trying to figure out Python. I am getting errors that > I don't know how to fix. What d

[Tutor] Help with Python

2014-05-11 Thread Glen Chan
Hello, I am a student trying to figure out Python. I am getting errors that I don't know how to fix. What do you do after you get the error message and something is highlighted? Does that have to be deleted? Anyway, here is what I mean... #>>> The Dice Game #add libraries needed import rando

Re: [Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread Steven D'Aprano
Hello "1 2", and welcome! (By the way, I feel quite silly calling you by the name you show in your email address. Do you have another name you would prefer to be known by?) My response below. On Sat, May 10, 2014 at 02:35:07PM +0800, 1 2 wrote: > In the result it shows "s= 8" pls tell me how

Re: [Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread Alan Gauld
On 10/05/14 07:35, 1 2 wrote: In the result it shows "s= 8" pls tell me how to remove the blank? s,t,n = 0,0,1 while t <= s: s,t,n = s+2,t+n,n+1 else: print('s=',s,n) Assuming you are using Python version 3 you need to specify the sep option to print: print('s=',s,n,sep='') >>> h

Re: [Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread Chris “Kwpolska” Warrick
On Sat, May 10, 2014 at 8:35 AM, 1 2 wrote: > In the result it shows "s= 8" pls tell me how to remove the blank? > > s,t,n = 0,0,1 > while t <= s: > s,t,n = s+2,t+n,n+1 > else: > print('s=',s,n) You must use something else. For example: print('s={0} {1}'.format(s, n)) This will pro

[Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread 1 2
In the result it shows "s= 8" pls tell me how to remove the blank? s,t,n = 0,0,1 while t <= s: s,t,n = s+2,t+n,n+1 else: print('s=',s,n) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.or

Re: [Tutor] Help With Code

2014-05-04 Thread Dave Angel
jordan smallwood Wrote in message: > > want to have the user try again if they enter in a non integer. What am I > missing: Do you perhaps mean float? If so, see the other response. -- DaveA ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] Help With Code

2014-05-04 Thread Alan Gauld
On 01/05/14 01:18, jordan smallwood wrote: Hey there, I have this code below (in to cm conversion) and I want to have the user try again if they enter in a non integer. What am I missing: A loop. There is a common pattern or idiom in Pytthon: while True: get input if input ok:

[Tutor] Help With Code

2014-05-04 Thread jordan smallwood
Hey there, I have this code below (in to cm conversion) and I want to have the user try again if they enter in a non integer. What am I missing: ConversionConstant = 2.54 def CalculateCentimeters(inches):     return ConversionConstant * inches def CalculateInches(centimeters):     return centi

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
As others have pointed out, a mapping/dictionary or just a list of lists seems like how you would want to organize the data for input. I think your problem is insistence on using sets. I am no Python guru, but I think this list is more for exploratory learning of Python. I think people are trying t

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Thanks for the response Smith, I was thinking make be I have done something incorrect and if there is some other function that can be used to display the output in desired order but don't see it possible thats why was wondering if any of you Python gurus have any inputs for me :-) On Sat, Apr 26

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
err, set also is unordered. I can see you are using set for a reason, but has no concept of order. On Sat, Apr 26, 2014 at 3:20 PM, C Smith wrote: > Just glancing at your work, I see you have curly braces around what looks > like it should be a list. If you are concerned with the order of your >

Re: [Tutor] Help needed

2014-04-26 Thread C Smith
Just glancing at your work, I see you have curly braces around what looks like it should be a list. If you are concerned with the order of your output, dictionaries do not have a concept of order. On Sat, Apr 26, 2014 at 3:16 PM, Suhana Vidyarthi wrote: > Hi Danny, > > Let me give you a high le

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Hi Danny, Let me give you a high level brief of what I am doing: I am working on doing "disaster aware routing" considering the 24-node US network where I will be setting up connection between two any two nodes (I will select the source and destination nodes randomly). Also I have some links whose

Re: [Tutor] Help needed

2014-04-26 Thread Danny Yoo
>>> I want to create two arrays using the above file (Links array and Prob >>> array) that should give following output: >>> >>> *Links *= { [3,5] [5,4] [5,8] [7,8] [14,10] [14,13] [17,13] [14,18] >>> [10,13] [14,13] [17,13] [12,13] [11,6] [11,9][11,12] [11,19] [19,20] >>> [15,20] [21,20] [20,21] [

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Thanks for the response Alan. my clarifications are below: On Sat, Apr 26, 2014 at 1:41 AM, Alan Gauld wrote: > On 26/04/14 01:46, Suhana Vidyarthi wrote: > > I have this file: >> >> 1,3,5,0.03 >> >> 2,3,5,5,4,0.11 >> >> 3,3,5,5,4,5,8,0.04 >> > > >> And each line is interpreted as: >> >>

Re: [Tutor] Help needed

2014-04-26 Thread Suhana Vidyarthi
Hi, The reason I opened a link is because there are changes in the code. Does it make sense? Else I can definitely go back to the thread. On Sat, Apr 26, 2014 at 9:05 AM, Danny Yoo wrote: > Hi Suhana, > > Also note that you asked this question just a few days ago. > > https://mail.pytho

Re: [Tutor] Help needed

2014-04-26 Thread Danny Yoo
Hi Suhana, Also note that you asked this question just a few days ago. https://mail.python.org/pipermail/tutor/2014-April/101019.html We're not robots. We don't like repetition unless there's a reason for it, and in this case, you got responses to the earlier question. For example: htt

Re: [Tutor] Help needed

2014-04-26 Thread Alan Gauld
On 26/04/14 01:46, Suhana Vidyarthi wrote: I have this file: 1,3,5,0.03 2,3,5,5,4,0.11 3,3,5,5,4,5,8,0.04 And each line is interpreted as: * 1,3,5,0.03-> This line means 1 link can be down i.e. between 3—5 with a probability of failure *0.03* * 2,3,5,5,4,0.11 -> This line mean

[Tutor] Help needed

2014-04-25 Thread Suhana Vidyarthi
Hi, I need help with coding for the problem below. I am new in this area, so needed help. If anyone can help me program the below scenario, I will be thankful. I have this file: 1,3,5,0.03 2,3,5,5,4,0.11 3,3,5,5,4,5,8,0.04 2,5,8,7,8,0.04 3,14,10,14,13,17,13,0.04 1,14,18,0.06 4,10,13,

Re: [Tutor] Help With an Assignment

2014-04-25 Thread Dave Angel
jordan smallwood Wrote in message: Do you know what a module is? Can you use a text editor to create one? Do you know what a function looks like? Try writing the first one they asked. Post it here, along with some test code showing it works, or describe what goes wrong. And while you're

Re: [Tutor] Help With an Assignment

2014-04-25 Thread Alan Gauld
On 25/04/14 20:52, jordan smallwood wrote: Hello, I am new to Python. I mean completely new and we're working on this problem set where they give us specs and we have to build something based off these specs. I have no idea what they're asking. Its pretty clear. They want you to build a module

[Tutor] Help With an Assignment

2014-04-25 Thread jordan smallwood
Hello, I am new to Python. I mean completely new and we're working on this problem set where they give us specs and we have to build something based off these specs. I have no idea what they're asking. Could someone help get me started on the path to figuring this out? Below is the question:

Re: [Tutor] Help needed with Python programming

2014-04-22 Thread Danny Yoo
Unfortunately, we can't give too much specific help on your particular problem because it's homework. You should use the knowledge you learned in your introductory programming class about designing programs. In particular, give a name to the function or functions your are designing. Be rigorous

Re: [Tutor] Help needed with Python programming

2014-04-22 Thread Mark Lawrence
On 22/04/2014 12:41, Steven D'Aprano wrote: On Mon, Apr 21, 2014 at 06:16:20PM -0700, Suhana Vidyarthi wrote: [...] # on Windows either of these will be okay filename = "C:/path/to/file.txt" filename = "C:\\path\\to\\file.txt" Or a raw string r'C:\path\to\file.txt' -- My fellow Pythonis

Re: [Tutor] Help needed with Python programming

2014-04-22 Thread Steven D'Aprano
On Mon, Apr 21, 2014 at 06:16:20PM -0700, Suhana Vidyarthi wrote: [...] > I have a python code that shows a set of shortest paths between nodes A and > B. Now I have to select the least risky path among them. To do that I have > to consider the risk values of each link. I know how to calculate the

Re: [Tutor] Help needed with Python programming

2014-04-22 Thread Alan Gauld
On 22/04/14 02:16, Suhana Vidyarthi wrote: I have a python code that shows a set of shortest paths between nodes A and B. It would help if you showed us this code. Otherwise we are just making wild guesses about how you are modelling this. Also knowing which Python version you are using would

[Tutor] Help needed with Python programming

2014-04-22 Thread Suhana Vidyarthi
My knowledge of coding is fairly limited and I am having a hard time writing a Python code which might be pretty simple for you :-) Here is what I am doing and I need help with: I have a python code that shows a set of shortest paths between nodes A and B. Now I have to select the least risky pat

Re: [Tutor] Help Noob Question

2014-03-28 Thread Alan Gauld
On 28/03/14 15:27, Chris “Kwpolska” Warrick wrote: On Fri, Mar 28, 2014 at 2:17 AM, Alan Gauld wrote: Because the desktop is hardly ever anywhere near where the cmd prompt lands you. I just tested on my Windows 7 box. It got me to C:\Users\Kwpolska. `cd Desktop` is enough. I also tested on

Re: [Tutor] Help Noob Question

2014-03-28 Thread David Rock
* Chris “Kwpolska” Warrick [2014-03-28 16:27]: > > Create a folder on the desktop, or even in the home directory. A much > nicer place than the drive root — and a much modern way to store it > (drive root sounds DOS-y) I'll have to disagree with this statement. Dropping all your files in you De

Re: [Tutor] Help Noob Question

2014-03-28 Thread Walter Prins
Hi Leo, On 27 March 2014 08:43, Leo Nardo wrote: > Im on windows 8 and i need to open a file called string1.py that is on my > desktop, in both the interpreter and notepad++, so that i can work on it. I > already have it open in notepad, but for the life of me cannot figure out > how to open it i

Re: [Tutor] Help Noob Question

2014-03-28 Thread Chris “Kwpolska” Warrick
On Fri, Mar 28, 2014 at 2:17 AM, Alan Gauld wrote: > On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote: >> Painful? How painful can `cd Desktop` be? Certainly less than `D:` >> followed by `cd PythonProjects`… > > > Because the desktop is hardly ever anywhere near where the cmd prompt lands > you.

Re: [Tutor] Help Noob Question

2014-03-28 Thread Alan Gauld
On 28/03/14 09:28, spir wrote: On 03/28/2014 02:17 AM, Alan Gauld wrote: you have to remember where it is. There is no ~ shortcut in Windows. On my system that means typing something like: C:\Documents and Settings\alang\Desktop Can't you make a symlink pointing to Desktop? (in C:\ or anywh

Re: [Tutor] Help Noob Question

2014-03-28 Thread Mark Lawrence
On 28/03/2014 01:17, Alan Gauld wrote: On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote: On Mar 27, 2014 8:58 PM, "Alan Gauld" mailto:alan.ga...@btinternet.com>> wrote: > > On 27/03/14 06:43, Leo Nardo wrote: >> >> Im on windows 8 and i need to open a file called string1.py that is on >> m

Re: [Tutor] Help Noob Question

2014-03-28 Thread spir
On 03/28/2014 02:17 AM, Alan Gauld wrote: On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote: On Mar 27, 2014 8:58 PM, "Alan Gauld" mailto:alan.ga...@btinternet.com>> wrote: > > On 27/03/14 06:43, Leo Nardo wrote: >> >> Im on windows 8 and i need to open a file called string1.py that is on >

Re: [Tutor] Help Noob Question

2014-03-27 Thread Alan Gauld
On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote: On Mar 27, 2014 8:58 PM, "Alan Gauld" mailto:alan.ga...@btinternet.com>> wrote: > > On 27/03/14 06:43, Leo Nardo wrote: >> >> Im on windows 8 and i need to open a file called string1.py that is on >> my desktop, > > > Thats your first pro

Re: [Tutor] Help Noob Question

2014-03-27 Thread Mark Lawrence
On 27/03/2014 19:56, Alan Gauld wrote: On 27/03/14 06:43, Leo Nardo wrote: Im on windows 8 and i need to open a file called string1.py that is on my desktop, Thats your first problem. Its usually a bad idea to store your python code on the desktop, because the desktop is a pain to find from a

Re: [Tutor] Help Noob Question

2014-03-27 Thread Chris “Kwpolska” Warrick
On Mar 27, 2014 8:58 PM, "Alan Gauld" wrote: > > On 27/03/14 06:43, Leo Nardo wrote: >> >> Im on windows 8 and i need to open a file called string1.py that is on >> my desktop, > > > Thats your first problem. Its usually a bad idea to store your python code on the desktop, because the desktop is a

Re: [Tutor] Help Noob Question

2014-03-27 Thread Alan Gauld
On 27/03/14 06:43, Leo Nardo wrote: Im on windows 8 and i need to open a file called string1.py that is on my desktop, Thats your first problem. Its usually a bad idea to store your python code on the desktop, because the desktop is a pain to find from a command line. Instead create a folde

Re: [Tutor] Help Noob Question

2014-03-27 Thread Dave Angel
Leo Nardo Wrote in message > > Im on windows 8 and i need to open a file called string1.py that is on my desktop, in both the interpreter and notepad++, so that i can work on it. I already have it open in notepad, but for the life of me cannot figure out how to open it in the interpreter. In

Re: [Tutor] Help Noob Question

2014-03-27 Thread Ben Finney
Leo Nardo writes: > Im on windows 8 and i need to open a file called string1.py that is on > my desktop, in both the interpreter and notepad++, so that i can work > on it. It's not clear what you want. What does it mean to you for a Python program to be “open in the interpreter”? You have opene

Re: [Tutor] Help Noob Question

2014-03-27 Thread Mark Lawrence
On 27/03/2014 08:55, David Palao wrote: Hello, What do you mean by "open it in the interpreter"? Do you want to open it and read from it its content? or do you want to execute its python code within the interpreter? Best 2014-03-27 7:43 GMT+01:00 Leo Nardo : Im on windows 8 and i need to open a

Re: [Tutor] Help Noob Question

2014-03-27 Thread David Palao
Hello, What do you mean by "open it in the interpreter"? Do you want to open it and read from it its content? or do you want to execute its python code within the interpreter? Best 2014-03-27 7:43 GMT+01:00 Leo Nardo : > Im on windows 8 and i need to open a file called string1.py that is on my > d

[Tutor] Help Noob Question

2014-03-27 Thread Leo Nardo
Im on windows 8 and i need to open a file called string1.py that is on my desktop, in both the interpreter and notepad++, so that i can work on it. I already have it open in notepad, but for the life of me cannot figure out how to open it in the interpreter. Invalid syntax is the error message when

Re: [Tutor] help

2014-03-18 Thread Alan Gauld
On 18/03/14 18:21, Joel Goldstick wrote: List On Mar 18, 2014 11:08 AM, "y j" mailto:yashp...@gmail.com>> wrote: how can i split a word into letters in python 2.7.6? or more specifically list(aString) - lowercase and with params. That will give you a list of the individual letters. Assum

Re: [Tutor] help

2014-03-18 Thread Joel Goldstick
List On Mar 18, 2014 11:08 AM, "y j" wrote: > how can i split a word into letters in python 2.7.6? > > -- > Y D Jain > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listi

Re: [Tutor] help (Splitting a word into letters)

2014-03-18 Thread David Rock
* y j [2014-03-18 16:41]: > how can i split a word into letters in python 2.7.6? Strings can already be accessed as arrays: >>> s='foobar' >>> print s[2] o >>> print s[4] a >>> print s[7] Traceback (most recent call last): File "", line 1, in IndexError: string index out of range >>> Can

[Tutor] help

2014-03-18 Thread y j
how can i split a word into letters in python 2.7.6? -- Y D Jain ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

<    1   2   3   4   5   6   7   8   9   10   >