Dec-08-2018, 05:40 PM
(This post was last modified: Dec-08-2018, 06:19 PM by Gribouillis.)
I have a couple of questions about this code.
First, this block:
Next, I don't see where the class 'klass' is used anywhere in the script at all, so I'm confused as to why it is there to begin with.
If I comment out that block of code, the program runs, but not as stated. Here is the output I get when I run it:
I haven't yet looked too closely at the rest of the code. When I do, I will get back to you about anything I notice that might help.
First, this block:
class klass: "docstring" def_int-self: self.attribute="var" if len (self.attribute)<2: passraises a SyntaxError on my machine for "invalid syntax" at 'def_int-self:'
Next, I don't see where the class 'klass' is used anywhere in the script at all, so I'm confused as to why it is there to begin with.
If I comment out that block of code, the program runs, but not as stated. Here is the output I get when I run it:
Output: % phonecon.py
This program will return all the letter conbinations
that are available on the modern phone
You just type in a seven digit number and let the program display
all the letter conbinations that make up that number Enjoy
Enter (0) to exit out of the program
Enter a 7 digit phone number (NO spaces)>> 4487125
Enter numbers only no letters or special characters
Enter (0) to exit out of the program
Enter a 7 digit phone number (NO spaces)>> 0
Enter numbers only no letters or special characters
Enter (0) to exit out of the program
Enter a 7 digit phone number (NO spaces)>>
and that is it. It does not show me any letter combinations and 0 does not exit the program. I have to do a 'ps -e |grep python' to get a process id on the script then 'kill <pid>', because 'Ctrl-c' doesn't work to terminate it either.I haven't yet looked too closely at the rest of the code. When I do, I will get back to you about anything I notice that might help.