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
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:
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
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
>
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
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 =
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
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
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