Hi as a challenge I have got to sum a series i / (i+1). My code isn't
summing right. Any ideas why?
def main():
print("{0:15s}{1:20s}".format("i","m(i)"))
for i in range(1,20):
print("{0:<15d}{1:<20.4f}".format(i,m(i)))
def m(i):
total = 0
for i in range(1,i+1,1):
> > Date: 11 May 2017 12:26 pm
> > Subject: Re: [Tutor] While Loop Question
> > To: "Rafael Skovron"
> > Cc:
> >
> > i modified your code to make it look like that :
> >
> > for i in range(1, 5):
> >
> > j=0
> >
Sorry I left out the indents in my previous email. It seems like j is
always reset to zero. Why does j vary?
Are there two different instances of j going on?
for i in range(1, 5):
j=0
while j < i:
print(j, end = " ")
j += 1
___
I dont understand why j can have any value other than zero in this:
for i in range(1, 5):
j = 0
while j < i:
print(j, end = " ")
j += 1
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mai
This project compares two text files with parcel numbers. I think I'm
messing up the function call. I'm getting this error:
Traceback (most recent call last):
File "amador.py", line 48, in
remaining_parcels(auctionlist,removedlist)
NameError: name 'auctionlist' is not defined
import re
I'm trying to learn how to use Classes but I keep getting NameErrors no
matter what code I put into the script.
Any ideas why?
My general workflow is I edit in vim, then invoke python3 interpreter,
import the module and try to use the Class and methods from the class.
For example, importing cus