[Tutor] Python Help with Program

2015-02-15 Thread Tina Figz
I'm having a problem with my program and I'm not sure how to correct it (I'm in an intro programming class). My program is supposed two numbers and count the number of carry operations. This is what I have: n1 = int(raw_input('Number #1: ')) n2 = int(raw_input('Number #2: ')) add = n1 + n2 print

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-15 Thread Peter Otten
Alan Gauld wrote: > On 14/02/15 09:55, Peter Otten wrote: > >> with open(headerfile) as f: >> lookup_header = { >> headerdata[:6]: headerdata.rstrip("\n") for headerdata in f} >> >> Then you can iterate over the lines in linefile, extract the key from >> that and look it up in the d

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-15 Thread Peter Otten
Joel Goldstick wrote: > You can dispense with the slicing if you use the str.split() method. It > will put each item in a list. Only if there are no whitespace chars in the field. OT: Joel, your comments are already quoted when you first post them. Something is broken in your workflow. ___

Re: [Tutor] Does anyone here has the problems of CS231 saved?

2015-02-15 Thread Anubhav Yadav
> > Looks like the Internet Archive has a copy from 2013-Jun-23: > > < > https://web.archive.org/web/*/http://www.cse.msu.edu/~cse231/PracticeOfComputingUsingPython/ > > > > > Thanks a lot. That helps a lot. Although the problems are very less in comparison to the ones that were latest, I think I c

Re: [Tutor] Does anyone here has the problems of CS231 saved?

2015-02-15 Thread Peter Otten
Anubhav Yadav wrote: > I used to solve the programming problems of the CS231 course of the > Michigan State University, they had many python programming problems > listed on a website [1]. > > Now suddenly the website seems to be down and I was wondering if anyone > has a local copy of this probl

[Tutor] Does anyone here has the problems of CS231 saved?

2015-02-15 Thread Anubhav Yadav
I used to solve the programming problems of the CS231 course of the Michigan State University, they had many python programming problems listed on a website [1]. Now suddenly the website seems to be down and I was wondering if anyone has a local copy of this problems with them and is willing to sh