Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
While loops
#4
(Mar-06-2017, 12:30 AM)Larz60+ Wrote:
L = [2, 4, 6, 8]
print(sum(L))
L = []

Why are you setting 'L' to an empty list?

Edit:
Never mind, I see that is what the OP ends up with, though I'm not sure why he would want that.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
While loops - by Miraclefruit - Mar-06-2017, 12:05 AM
RE: While loops - by micseydel - Mar-06-2017, 12:16 AM
RE: While loops - by Larz60+ - Mar-06-2017, 12:30 AM
RE: While loops - by sparkz_alot - Mar-06-2017, 01:03 AM
RE: While loops - by Miraclefruit - Mar-06-2017, 01:49 AM
RE: While loops - by Larz60+ - Mar-06-2017, 03:36 AM
RE: While loops - by sparkz_alot - Mar-06-2017, 02:00 PM
RE: While loops - by nilamo - Mar-06-2017, 09:30 PM

Forum Jump:

User Panel Messages

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