By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 2,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

Problem trying to append data.

P: 11
Hello, I'm new to this website. I want to thank everyone here for the wonderful
help you are providing to the community.
I stated teaching myself programming in python only a few weeks back and
I'm trying to add new features to a japanese verb conjugator (a program a friend wrote for me)
. I succeeded in making a few improvements to the original code but I seem to be stucked trying to append a particular list. I'd really appreciate if someone would lend a helping hand here.
It shouldn't take more than a couple of minutes for an experienced python programmer to fugure out what I'm doing wrong.

Attached Files
File Type: txt striped_conjugator_00.txt (3.2 KB, 199 views)
May 7 '10 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 2.5K+
P: 2,851
Unfortunately, your code is missing some assignments and will not run. I cannot tell what the problem is nor can I determine what the code does. For example, "verbList" and "exceptions" are not defined. If you could post some code that works except for the error, I will try to help.
May 7 '10 #2

P: 11
Hello, bvdet,
Thank you for your quick support.
I haven't figured out how to attach a new file in order to be able to upload a more complete file.
But I you'd be kind enough to go ahead and add the next three lines to the code, the code should run.
Thank you so very much for all your help.

exceptions = ["asuru"]
verbList = ""
replace: verbfile = ["nomu","toru","naru"]
May 8 '10 #3

Expert Mod 2.5K+
P: 2,851

The script fails with this error:
"if mytype == vruends or mytype == eruends or mytype == buends......
NameError: global name 'eruends' is not defined"
There are undefined variables in function whattype().

A suggestion - instead of
Expand|Select|Wrap|Line Numbers
  1. if mytype == vruends or mytype == eruends or mytype == buends.....
test for membership with the in operator:
Expand|Select|Wrap|Line Numbers
  1. if mytype in [vruends, eruends, buends,.......]
May 8 '10 #4

P: 11
Hello, bvdet,
Thank you for all your help. Sorry about the failing error.
A experimented and tried as many thing as I could come up with and
eventually I was able sole the problem.
The problem was mostly an issue with indentation.
Now, I'm ready to start working on the next phase of the program.

Thank so much for all your support.
This will be the first place I go for help next time I get stucked!
Cheers everyone
May 8 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.