Tag: print

Python Programming Tutorial for Beginners – Part 3 – Printing and commenting
Tech Tips

Python Programming Tutorial for Beginners – Part 3 – Printing and commenting

Displaying or "printing" information to the screen in Python is done using the print() function. So although we have been fiddling with datatypes up to now we haven't displayed them, so first let's try doing that using the variables we were experimenting with before: x = 3 y = 2.2 z = "Cuba" i = True *save the file as geezam_python.py - ensure its a dot py file which is the python file type To show each of them on screen we type the print function with the name of the variable within brackets like so: print() function print(x) print(y) print(z) print(i) Click run in Thonny and voila! the values displayed on the screen. We can also put values directly in the print function by entering them within the brackets. just remember that when it comes to strings we need to use the doub...