- ## INTRODUCTION Python is a programming language that is used to write code for:
data science
machine language
web development
Reasons to use python
- It's easy to understand the code
- has a simple syntax
- enables users to write fewer lines of code
- the code is portable
- ## Getting started with python
Installation
you can access the downloads from the python site.
after download, install to your machine
how to check installation
run the code below in CMD
The result should be as follows;
- ## ** Writting first code** python files have the extension .py example hello.py we can write our hello world code in cmd editor in the file saved as hello word.py print("Hello, World!") Output
- ##Components of python
- variables
they are used to store data values in python
example
x = 5 y = "John" print(x) print(y)
Output will be
5
John
- lists
they are used to store multiple variables
list1 = ["apple", "banana", "mango"] print(list1)
output
apple
banana
mango
- Sets
they store multiple items in a single variable
example
set = {"apple,mango, banana"} print (set)
Top comments (0)