On Fri, Jan 7, 2011 at 8:28 PM, Ned Deily <[email protected]> wrote:
> In article
> <[email protected]>,
> Garland Fulton <[email protected]> wrote:
> > I don't understand what I'm doing wrong i've tried several different
> cases
> > for what i am doing here. Will someone please point my error out.
>
> > 15 print("counter: ", counter
>
> Missing ")" on line 15.
>
> --
> Ned Deily,
> [email protected]
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
1 #!/bin/bash/python
2 import math
3 try:
4 x = int(input("Enter your number: "))
5 if 0 > x > 2147483647:
6 raise Exception()
7 else:
8 end = 0
9 count = 0
10 count1 = x
11 counter = 0
12 print("end: ", end)
13 print("count: ", count)
14 print("count1: ", count1)
15 print("counter: ", counter)
16
17 while end == 0: #
<-------------------returns syntax error on this while statement
18 if(count < x):
19
20 sol = math.pow(count, 2) + math.pow(count1, 2)
21 count += 1
22 count1 -= 1
23 print("end: ", end)
24 print("count: ", count)
25 print("count1: ", count1)
26 print("counter: ", counter)
27 if sol == x:
28 counter += x
29 else:
30 end = 1
31 except Exception as ran:
32 print("Value not within range", ran)
File "blah.py", line 17
while (end == 0): #
<-------------------returns syntax error on this while statement
^
IndentationError: unexpected indent
Thank you and I'm sorry for the very blind question, it was because of the
missing par-ends I have spent a while on this won't happen again. What is
wrong with my shebang line?
Thank you for the syntax tips!
--
http://mail.python.org/mailman/listinfo/python-list