Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regarding problem3_6, i am using below mentioned code. but getting error saying "list index out of range in line 5 which is infile=sys.argv[1]" #2

Open
annu68 opened this issue Nov 8, 2020 · 1 comment

Comments

@annu68
Copy link

annu68 commented Nov 8, 2020

import sys

infile = sys.argv[1]
outfile = sys.argv[2]

infile = open(infile)
outfile = open(outfile, 'w')

for line in infile:
line = line.strip("\n")
outfile.write(str(len(line)) + "\n")

infile.close()
outfile.close()

@ChiragKhameshra
Copy link

Did u find the answer because I am getting the same error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants