Editing Community Data Science Course (Spring 2023)/Week 3 lecture notes
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 32: | Line 32: | ||
** ''Note:'' These can be useful in combination to if statements and can also be super useful for debugging! | ** ''Note:'' These can be useful in combination to if statements and can also be super useful for debugging! | ||
* Writing to files: | * Writing to files: | ||
** Using the <code>open( | ** Using the <code>open()</code> function | ||
** Using the | ** Using the with statement | ||
** Writing to a file with <code>print(file=my_file)</code> | ** Writing to a file with <code>print(file=my_file)</code> | ||
** Writing a tab-separated value file using "\t" (make sure we leave a header!) | ** Writing a tab-separated value file using "\t" (make sure we leave a header!) |