Day 1: Getting Started with Python - A Journey into the World of Programming


Day - 1 Python 


Introduction

Welcome to Day 1 of our Python journey! Today marks the beginning of an exciting adventure into the world of programming with Python. Whether you are a complete beginner or have some programming experience, this journey will equip you with the essential skills and knowledge to become proficient in Python. Let's dive in!

Getting Set Up

The first step on our Python journey is setting up our development environment. Python is a versatile programming language that can run on various platforms, including Windows, macOS, and Linux. Here are the basic steps to get started:

  1. Install Python: Visit the official Python website (python.org) and download the latest version of Python suitable for your operating system. Follow the installation instructions provided.

  2. Text Editor or Integrated Development Environment (IDE): Choose a text editor or IDE to write your Python code. Popular choices include Visual Studio Code, PyCharm, Atom, or Sublime Text. Pick the one that suits your preferences and install it.

  3. Verify Installation: Open a terminal or command prompt and type "python --version" to verify that Python is installed correctly. You should see the version number displayed.

Python Syntax

Python is known for its clean and readable syntax, which makes it beginner-friendly and easy to understand. Let's explore some basic Python syntax:

  1. Hello, World!: The traditional first program in any programming language is the "Hello, World!" program. In Python, it can be written with just one line of code:
print("Hello, World!")

Running this code will display "Hello, World!" in the console.

Variables and Data Types

What is a variable?

You can think about variables like an empty block in memory that can contain data just like in maths you used to assign variables like x and y.

Python is dynamically typed, meaning you don't need to declare variable types explicitly. You can assign values to variables as follows:

message = "Welcome to Python!"
number = 42
pi = 3.14159

Python supports various data types, including strings, integers, floating-point numbers, lists, tuples, dictionaries, and more.

integers

integers are whole numbers that cannot contain a decimal such as

n1 = 15
n2 = 14

floating point numbers

numbers that contain a floating point such as

n1 = 15.5
n2 = 1.0
n3 = 14.55

strings

strings is basically text, in python it can be defined using quotes or double quotes such as

s1 = 'hello'
s2 = "hello"

We will discuss lists, tuples, dictionaries and sets in later articles.

Conclusion

Hurray, today you have written your first python program the famour HELLO WORLD Program, you also learned how to define variables and you learned about data types. You are one step further to become a tech wizard!

Comments