Re: [Tutor] Loop not iterating

2015-07-05 Thread Nym City via Tutor
This is pretty cool, Thank you for explaining! I liked the second solution.  Thank you. On Sunday, July 5, 2015 2:10 AM, Steven D'Aprano wrote: Hi Nym, sorry your code's formatting is broken again. I've tried my best to fix it below: On Fri, Jul 03, 2015 at 09:04:10PM +, Nym

Re: [Tutor] Loop not iterating

2015-07-04 Thread Steven D'Aprano
Hi Nym, sorry your code's formatting is broken again. I've tried my best to fix it below: On Fri, Jul 03, 2015 at 09:04:10PM +, Nym City via Tutor wrote: > Thank to very much for replying.  The second solution that you proposed > worked perfectly: > > import csv > domains = open('top500doma

Re: [Tutor] Loop not iterating

2015-07-03 Thread Nym City via Tutor
Thank to very much for replying.  The second solution that you proposed worked perfectly: import csvdomains = open('top500domains.csv')domainsReader = csv.reader(domains)domains = ["https://www."; + row[1] for row in domainsReader]for domain in domains:    print(domain) The above solution is p

Re: [Tutor] Loop not iterating

2015-06-29 Thread Steven D'Aprano
On Tue, Jun 30, 2015 at 01:05:13AM +, Nym City wrote: > Hello all, > Thank you for your time and tips. The reason why I decided to create a > loop is because the output is cleaner and did not require any > formatting. However, based on what I have learned from all of your > responses, that i

Re: [Tutor] Loop not iterating

2015-06-29 Thread Nym City via Tutor
Hello all, Thank you for your time and tips. The reason why I decided to create a loop is because the output is cleaner and did not require any formatting. However, based on what I have learned from all of your responses, that is not going to work with what I am trying to do. Here is the updated

Re: [Tutor] Loop not iterating

2015-06-28 Thread Steven D'Aprano
Hi Nym, and welcome, On Sun, Jun 28, 2015 at 07:32:40PM +, Nym City via Tutor wrote: [...] > for domain in domainLists: > something = ("www." + str(domain)) > print(something) > > My program reads in a CSV file that has 500 list of domains. However, > when I save the output of my loop

Re: [Tutor] Loop not iterating

2015-06-28 Thread Mark Lawrence
On 28/06/2015 20:32, Nym City via Tutor wrote: Hello, I am working on my second program and its a two part progam that I want to design However, i am not sure what silly mistake I am making on the first part: Here is my code: | 2 3 4 5 6 7 | import csv domains = open('top500domains.csv') domain

Re: [Tutor] Loop not iterating

2015-06-28 Thread Alan Gauld
On 28/06/15 20:32, Nym City via Tutor wrote: import csv domains = open('top500domains.csv') domainsReader = csv.reader(domains) domainLists = list(domainsReader) for domain in domainLists: something = ("www." + str(domain)) You overwrite something each time round the loop. print(somethi

[Tutor] Loop not iterating

2015-06-28 Thread Nym City via Tutor
Hello, I am working on my second program and its a two part progam that I want to design However, i am not sure what silly mistake I am making on the first part: Here is my code: | 2 3 4 5 6 7 | import csv domains = open('top500domains.csv') domainsReader = csv.reader(domains) domainLists = list(