Re: how to exit from a nested loop in python

2019-02-08 Thread Peter Otten
Kaka wrote: > for i in range(len(A.hp)): > > for j in range(len(run_parameters.bits_Mod)): > req_slots[j] = math.ceil((A.T[i]) > > for g in Temp[i]["Available_ranges"][j]: > for s in range(g[0], g[-1]): > if (s+req_slots[j]-1) <= g[-1]: >

Re: The sum of ten numbers inserted from the user

2019-02-08 Thread ^Bart
x = 0 for jnk in range(10): x += int(input("Enter a number: ") print(x) It works, there's a missed ) A colleague did: total=0 for n in range(10): n= int(input("Enter a number: ")) total=total+n print(total) I understood your code is more clean! ^Bart -- https://mail.pytho

Re: Loop with else clause

2019-02-08 Thread Adriaan Renting
Wow, you dug deep. My example was the reverse of the "toy example"'s you mention as I find that often code becomes much clearer if you order it such that specific cases, sanity checking and exceptions go first, and then the default case at the end. So my general suggestion would be to handle yo

Re: timezones

2019-02-08 Thread Jaap van Wingerde
The blog of Paul Gansele [1] made me trying an other approach. #!/usr/bin/env python3 # -*- coding: utf_8 -*- ### tested with python3.5 from datetime import datetime, timedelta, timezone from dateutil import tz amsterdam = tz.gettz('Europe/Amsterdam') utc = tz.gettz('utc') amsterdam_datetime = dat

Re: Python program to phone?

2019-02-08 Thread Mario R. Osorio
You will need to have java. BeeWare's VOC tool, a transpiler from python to java, will do all the work for you so you don't even have know anything about java, except installing and setting it up for your environment Dtb/Gby === Mario R. Osorio B.A.S. of Information Technology A.S. of Computer

Re: Python program to phone?

2019-02-08 Thread Mario R. Osorio
I am not an expert in BeeWare (I've never used it) but I've read a good portion of their documentation and find it very interesting to say the least. I am looking forward using it in the very near future. On Fri, Feb 8, 2019 at 11:06 AM Mario R. Osorio wrote: > You will need to have java. BeeWar

Re: how to exit from a nested loop in python

2019-02-08 Thread Rurpy via Python-list
On Thursday, February 7, 2019 at 11:45:23 PM UTC-7, Kaka wrote: > for i in range(len(A.hp)): > > for j in range(len(run_parameters.bits_Mod)): > req_slots[j] = math.ceil((A.T[i]) > > for g in Temp[i]["Available_ranges"][j]: > for s in range(g[0], g[-1]): >