All posts by Tuna Peyo

Make a list of lines from a file

Aug 10,97

It is possible to the place a lines in a file in a list, with each line representing a single …

Read More

Read and write – with statement

Aug 10,97

Another way in which you can read and write files is by using the with statement. The main benefit of …

Read More

Read a file

Aug 10,97

To read a file we’ve created in the previous lesson, we need to create a file object, but this time …

Read More

How to read and write files

Aug 10,97

Reading and writing files in Python is really easy since you don’t need to import a library – everything needed …

Read More

Looping over a tuple

Aug 9,97

Just like with lists, to loop through each item in a tuple, the for loop can be used: names = …

Read More

What are tuples?

Aug 9,97

Tuples in Python are similar to lists in a way that they are used to store a set of elements …

Read More
Geek University 2022