DEV Community

Mitleo
Mitleo

Posted on

Ultimate Python Guide

  1. ## 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
  1. ## 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

Image description
The result should be as follows;

Image description

  1. ## ** 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

Image description

  1. ##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
Enter fullscreen mode Exit fullscreen mode
  • lists they are used to store multiple variables list1 = ["apple", "banana", "mango"] print(list1) output
apple
banana
mango
Enter fullscreen mode Exit fullscreen mode
  • Sets they store multiple items in a single variable example set = {"apple,mango, banana"} print (set)

Top comments (0)