Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Basic Python - Tuples and Files

Beschreibung

none Python Basics (Object & Data Structure Basics) Karteikarten am Basic Python - Tuples and Files, erstellt von Rebecca Noel am 13/12/2016.
Rebecca Noel
Karteikarten von Rebecca Noel, aktualisiert more than 1 year ago
Rebecca Noel
Erstellt von Rebecca Noel vor mehr als 8 Jahre
10
0
1 2 3 4 5 (0)

Zusammenfassung der Ressource

Frage Antworten
How is a tuple constructed? Tuples use () with elements separated by commas. t = (1,2,3)
T/F?: Tuples can be created with mixed types of elements. True
T/F?: The len() check does NOT work with tuples. False
T/F?: Slicing works with tuples the same it does with lists. True
What two methods are available for tuples? .count and .index
What very important characteristic differentiates tuples from lists? IMMUTABLE
What function is used to open a file (.txt)? open() ex: f = open('test.txt')
Explain what these functions do with files: .read() .seek() .readlines() - reads the file - seek back to a different point in the file - reads lines of file without resetting
If you are trying to read a large file which function is preferred; .read() or .readlines()? .read()
What jupyter notebook exclusive way can we write a new file? %%writefile new.txt First line Second line
Zusammenfassung anzeigen Zusammenfassung ausblenden

0 Kommentare

There are no comments, be the first and leave one below:

ähnlicher Inhalt

Think Python
tsilvo2001
Basic Python - Print Formatting
Rebecca Noel
What is Python?
Daniel Ingram
Python
54671
Know your Python!
educ8ict
Basic Python - Strings
Rebecca Noel
Study on IoT systems design
Tomasz Cieplak
OpenSource Programming
Faheem Ahmed
Basic Python - Lists
Rebecca Noel
Python
Kirstie Wu