Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If elif else alternative
#7
(Apr-11-2017, 12:07 PM)in addition one could use dict comprehension to construct the dict Wrote:
d = {k+1:10**k for k in range(5)}

That's great, as potentially the range may be higher than the 100000 I've detailed.  Dance
Reply


Messages In This Thread
If elif else alternative - by brocq_18 - Apr-11-2017, 11:35 AM
RE: If elif else alternative - by Larz60+ - Apr-11-2017, 11:42 AM
RE: If elif else alternative - by buran - Apr-11-2017, 11:42 AM
RE: If elif else alternative - by brocq_18 - Apr-11-2017, 11:55 AM
RE: If elif else alternative - by metulburr - Apr-11-2017, 12:00 PM
RE: If elif else alternative - by buran - Apr-11-2017, 12:07 PM
RE: If elif else alternative - by brocq_18 - Apr-11-2017, 12:49 PM
RE: If elif else alternative - by Ofnuts - Apr-12-2017, 08:06 AM
RE: If elif else alternative - by ankit - Apr-12-2017, 06:55 AM
RE: If elif else alternative - by wavic - Apr-12-2017, 07:39 AM
RE: If elif else alternative - by buran - Apr-12-2017, 08:02 AM
RE: If elif else alternative - by buran - Apr-12-2017, 08:12 AM
RE: If elif else alternative - by brocq_18 - Apr-12-2017, 04:10 PM
RE: If elif else alternative - by micseydel - Apr-12-2017, 06:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Twilio alternative jmair 3 4,064 Feb-08-2024, 01:55 PM
Last Post: Sharmi
  Pillow alternative? kucingkembar 4 1,081 Jul-27-2023, 10:50 AM
Last Post: Larz60+
  Alternative for Cairosvg? Maryan 0 2,580 Oct-26-2020, 01:27 PM
Last Post: Maryan
  another alternative to np.interp evelynow 1 3,074 Aug-22-2019, 03:32 PM
Last Post: Larz60+
  Multithreading alternative MartinV279 1 2,908 Aug-01-2019, 11:41 PM
Last Post: scidam
  Whats the right way to refactor this Big if/elif/elif ? pitosalas 1 2,350 Jul-28-2019, 05:52 PM
Last Post: ichabod801
  Array alternative oldcity 3 3,643 Oct-01-2018, 10:03 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020