Python Forum
How to change from printFacts ( ) to return a list & Loop over list when writing CSV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change from printFacts ( ) to return a list & Loop over list when writing CSV
#9
It's not necessary to put comments on every piece of code. In Python, you can put a multistring comment right under the function definition so you could use it lately to build a documentation. 

def func():
    """This function doesn't do anything.
         It's just an example"
    pass
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: How to change from printFacts ( ) to return a list & Loop over list when writing CSV - by wavic - Aug-29-2017, 09:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  what to return for an empty list Skaperen 2 262 May-24-2024, 05:17 PM
Last Post: Skaperen
  Strange behavior list of list mmhmjanssen 3 462 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 429 Apr-18-2024, 09:55 PM
Last Post: deanhystad
  How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 Pleiades 8 15,967 Jan-05-2024, 08:30 PM
Last Post: sgrey
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,372 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Change font in a list or tuple apffal 4 2,800 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  Delete strings from a list to create a new only number list Dvdscot 8 1,744 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 1,005 Feb-23-2023, 02:21 PM
Last Post: sparkt
  Сheck if an element from a list is in another list that contains a namedtuple elnk 8 2,017 Oct-26-2022, 04:03 PM
Last Post: deanhystad
  convert this List Comprehensions to loop jacklee26 8 1,649 Oct-21-2022, 04:25 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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