What this error want to say? Can't we use return without function?

2020-09-07 Thread Shivlal Sharma
N = int(input("enter a positive integer:")) coun = 1 while (N > 0): coun = coun * N N = N - 1 return coun nice = ntime(N) print(nice) error: return outside of the function -- https://mail.python.org/mailman/listinfo/python-list

Re: What this error want to say? Can't we use return without function?

2020-09-07 Thread Terry Reedy
On 9/7/2020 3:34 AM, Shivlal Sharma wrote: nice = ntime(N) error: return outside of the function Please copy and paste exact text. Python actually said SyntaxError: 'return' outside function which means that a 'return' outside of a function is a syntax error. -- Terry Jan Reedy -- https:

Re: tinker Form question(s)

2020-09-07 Thread Peter Otten
Steve wrote: > I am not sure how to post the code for my file here, is copy/paste the > best way? Yes. Try to paste only the relevant parts, or, if possible, post a small self-contained example that can be run by the reader without further editing. > Is there another? I understand that attachm

Re: Replacement for pygtk?

2020-09-07 Thread Pete Forman
Akkana Peck writes: > Grant Edwards writes: >> * PyQt -- I run Gtk-centric Linux systems, and the second you try to >>use one Qt widget, it always seems to pull in hundreds of packages >>that take a week to build. > > I haven't generally found that about PyQt. Most KDE apps do pull in >

Re: What this error want to say? Can't we use return without function?

2020-09-07 Thread Shivlal Sharma
On Monday, 7 September 2020 at 13:10:57 UTC+5:30, Shivlal Sharma wrote: > On Monday, 7 September 2020 at 13:08:04 UTC+5:30, Chris Angelico wrote: > > On Mon, Sep 7, 2020 at 5:36 PM Shivlal Sharma wrote: > > > > > > On Monday, 7 September 2020 at 12:57:16 UTC+5:30, Python wrote: > > > > Shivlal

Re: What this error want to say? Can't we use return without function?

2020-09-07 Thread Shivlal Sharma
On Monday, 7 September 2020 at 13:08:04 UTC+5:30, Chris Angelico wrote: > On Mon, Sep 7, 2020 at 5:36 PM Shivlal Sharma wrote: > > > > On Monday, 7 September 2020 at 12:57:16 UTC+5:30, Python wrote: > > > Shivlal Sharma wrote: > > > > N = int(input("enter a positive integer:")) > > > > coun =

Re: What this error want to say? Can't we use return without function?

2020-09-07 Thread Chris Angelico
On Mon, Sep 7, 2020 at 5:36 PM Shivlal Sharma wrote: > > On Monday, 7 September 2020 at 12:57:16 UTC+5:30, Python wrote: > > Shivlal Sharma wrote: > > > N = int(input("enter a positive integer:")) > > > coun = 1 > > > while (N > 0): > > > coun = coun * N > > > N = N - 1 > > > return coun > > > nic

Re: What this error want to say? Can't we use return without function?

2020-09-07 Thread Shivlal Sharma
On Monday, 7 September 2020 at 12:57:16 UTC+5:30, Python wrote: > Shivlal Sharma wrote: > > N = int(input("enter a positive integer:")) > > coun = 1 > > while (N > 0): > > coun = coun * N > > N = N - 1 > > return coun > > nice = ntime(N) > > print(nice) > > > > > > error: return outside

tinker Form question(s)

2020-09-07 Thread Steve
I am not sure how to post the code for my file here, is copy/paste the best way? Is there another? I understand that attachments are stripped off. """ The following segment of code returns values of "spec". I would like to have it return the associated value of "DataLine" with each spec. It would