On 07/24/2017 04:32 PM, N6Ghost wrote:
> update code:
> f = open("C:\coderoot\python3\level1\inputfile.txt", 'r')
> for line in f:
> for line in f:
> print(line.rstripe())
>
> f.close()
>
>
> C:\coderoot\python3\level1>python secondscript.py
> Traceback (most recent call last):
> File "secondscript.py", line 5, in <module>
> print(line.rstripe())
> AttributeError: 'str' object has no attribute 'rstripe'
You presumably meant 'rstrip' (strip from right) rather than 'rstripe'.
With errors like this, look in the documentation to see the available
methods:
https://docs.python.org/3/library/stdtypes.html#string-methods
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor