On 2019-02-06 00:25, John Sanders wrote:
On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote:
Hi
I am trying to convert a switch statement from C into Python. (why? practising).
This is the C code.
printf("Dated this %d", day);
switch (day) {
case 1: case 21: case 3
On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote:
> Hi
>
> I am trying to convert a switch statement from C into Python. (why?
> practising).
>
> This is the C code.
>
> printf("Dated this %d", day);
> switch (day) {
> case 1: case 21: case 31:
> printf("st"
-Original Message-
From: Python-list On
Behalf Of DL Neil
Sent: Monday, February 4, 2019 11:29 PM
To: 'Python'
Subject: Loop with else clause
What is the pythonic way to handle the situation where if a condition exists
the loop should be executed, but if it does not something else shoul
The topic is how to deal with a python loop that may not be run if you want
something else to happen in that case. Multiple solutions are presented
along with this request:
> Is there another, more pythonic, approach to conditional (for/while)
> loop processing?
Has anyone considered looking at
I don't know if it is very Pythonic, but I would do something like
if no_oscar_nominees:
print ("Sorry ...")
else:
print_list_of_oscar_nominees()
And yes, that for/else construct can be confusing.
Adriaan.
>>> On 5-2-2019 at 5:29, DL Neil
wrote:
> What is the pythonic way to handl
As mentioned somewhere, "readability counts", so why not just go with exactly
what you said...
if len(nominees) > 0:#if a condition exists
for nominee in nominees: #the loop should be executed
print(nominee)
else:#but if not
Hi there Steve. Did you check BeeWare? (https://pybee.org/)
--
https://mail.python.org/mailman/listinfo/python-list
On 04/02/2019 23:12, Chris Roy-Smith wrote:
On 5/2/19 7:20 am, Steve wrote:
P.S. Yes, I tried to post this about two weeks ago but could not seem to
respond to the replies I received. I could contact one or two
individuals
but apparently not the masses. How do I find out how this list works
see pydroid and qpython on play store.2
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius
--
https://mail.python.org/mailman/listinfo/python-list
Python is the only immortal
On Tue, 5 Feb 2019, 17:01 python is alive
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
python is alive
--
https://mail.python.org/mailman/listinfo/python-list
DL Neil wrote:
> What is the pythonic way to handle the situation where if a condition
> exists the loop should be executed, but if it does not something else
> should be done?
> Possible solution:
> To make anything more than the trivial case readable, I think I'd put
> the list processing into
DL Neil writes:
> Possible solution:
> To make anything more than the trivial case readable, I think I'd put
> the list processing into one function, and the exception into another
> (except that this case is so trivial), ie
>
> if list:
> process_list() #the heading and for-l
13 matches
Mail list logo