In this article, I'll be exploring the basics of Python, i.e. variables, input and output. You'll need Python (2.7+), a computer, and some free time. Variables Simply put, variables are like envelopes ...
Takes an integer input from the user. Checks whether the number is even or odd using an if-else statement. Displays the result accordingly. Task 2: Sum of Integers from 1 to 50 Using a Loop Uses a for ...
File I/O Interacting with files on disk with Python is somewhat more complex than interacting with Python variables in memory. It is a form of I/O — meaning "input/output" — which means that we need ...