Lesson 3

List As the name suggests, a list stores a collection of similar data types. List allow duplicate values. fruits = ['orange', 'apple', 'pear', 'apple', 'banana'] #adds 'kiwi' to the end of the list fruits.append('kiwi') print(fruits) print(len(fruits)) #prints 6 which...

Sending email from Python

You can send email from Python, using the smtplib library. This library is a built-in library, so there are no additional steps to install. In this example, we are using the SMTP server information for gmail. You can use any SMTP server to send email. When you run...

Lesson 2

Programming in Python Saving code to py file So far you have been typing code directly in the Python console. You would have lost all the commands you wrote on you previous session. A better approach will be to save your code into a file with an extension of .py, so...

Multiplication Table

Print multiplication table for any given number. For example, if the given number is 9, then this program has to print the table as shown below. 1 X 9=9 2 X 9=18 3 X 9=27 and so on...   Version 1 Our first version is very simple. We copy and paste print...