Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99196 > unrolled thread
| Started by | Cai Gengyang <gengyangcai@gmail.com> |
|---|---|
| First post | 2015-11-20 22:54 -0800 |
| Last post | 2015-11-21 08:31 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.python
Traceback error Cai Gengyang <gengyangcai@gmail.com> - 2015-11-20 22:54 -0800
Re: Traceback error "Frank Millman" <frank@chagford.com> - 2015-11-21 09:26 +0200
Re: Traceback error Cai Gengyang <gengyangcai@gmail.com> - 2015-11-20 23:33 -0800
Re: Traceback error dieter <dieter@handshake.de> - 2015-11-21 08:31 +0100
| From | Cai Gengyang <gengyangcai@gmail.com> |
|---|---|
| Date | 2015-11-20 22:54 -0800 |
| Subject | Traceback error |
| Message-ID | <e5d80196-61c5-44d9-bec8-dc563d58fa6a@googlegroups.com> |
This is a piece of code about comparators : j# Assign True or False as appropriate on the lines below! # Set this to True if 17 < 328 or to False if it is not. bool_one = 17 < 328 # We did this one for you! # Set this to True if 100 == (2 * 50) or to False otherwise. bool_two = 100 == (2 * 50) # Set this to True if 19 <= 19 or to False if it is not. bool_three = 19 <= 19 # Set this to True if -22 >= -18 or to False if it is not. bool_four = -22 >= -18 # Set this to True if 99 != (98 + 1) or to False otherwise. bool_five = 99 != (98 + 1) When I tried to run it, this is the error I got : Traceback (most recent call last): File "python", line 1, in <module> NameError: name 'j' is not defined Any ideas how to debug this ? Thanks a lot! Appreciate it Cai Gengyang
[toc] | [next] | [standalone]
| From | "Frank Millman" <frank@chagford.com> |
|---|---|
| Date | 2015-11-21 09:26 +0200 |
| Message-ID | <mailman.29.1448090792.2291.python-list@python.org> |
| In reply to | #99196 |
"Cai Gengyang" wrote in message news:e5d80196-61c5-44d9-bec8-dc563d58fa6a@googlegroups.com... > This is a piece of code about comparators : > j# Assign True or False as appropriate on the lines below! [snip rest of code] > When I tried to run it, this is the error I got : > Traceback (most recent call last): > File "python", line 1, in <module> > NameError: name 'j' is not defined > Any ideas how to debug this ? It looks to me as if the error is right there on the first line. What is that 'j' doing there? It looks like a typo. HTH Frank Millman
[toc] | [prev] | [next] | [standalone]
| From | Cai Gengyang <gengyangcai@gmail.com> |
|---|---|
| Date | 2015-11-20 23:33 -0800 |
| Message-ID | <3e2577a5-a6e5-48b1-ae6a-6496403db7d0@googlegroups.com> |
| In reply to | #99197 |
Right ... I removed the 'j' and the code works now. I must have accidentally put it in , forgot about it and thought that it was part of the original code when it shouldn't have been there in the first place. Thanks ! On Saturday, November 21, 2015 at 3:27:02 PM UTC+8, Frank Millman wrote: > "Cai Gengyang" wrote in message > news:e5d80196-61c5-44d9-bec8-dc563d58fa6a@googlegroups.com... > > > This is a piece of code about comparators : > > > > j# Assign True or False as appropriate on the lines below! > > [snip rest of code] > > > When I tried to run it, this is the error I got : > > > Traceback (most recent call last): > > File "python", line 1, in <module> > > NameError: name 'j' is not defined > > > > Any ideas how to debug this ? > > > It looks to me as if the error is right there on the first line. What is > that 'j' doing there? It looks like a typo. > > HTH > > Frank Millman
[toc] | [prev] | [next] | [standalone]
| From | dieter <dieter@handshake.de> |
|---|---|
| Date | 2015-11-21 08:31 +0100 |
| Message-ID | <mailman.31.1448091309.2291.python-list@python.org> |
| In reply to | #99196 |
Cai Gengyang <gengyangcai@gmail.com> writes:
> This is a piece of code about comparators :
> j# Assign True or False as appropriate on the lines below!
> ...
> When I tried to run it, this is the error I got :
>
> Traceback (most recent call last):
> File "python", line 1, in <module>
> NameError: name 'j' is not defined
The error information is very precise: in your line 1, you have:
j# Assign True or False as appropriate on the lines below!
The "j" before the comment ("#...") is what causes the problem.
Likely, you did not want it there.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web