Python

Python

Hello, future coders! ๐Ÿ‘‹ Are you ready to delve into the magical world of Python programming? ๐ŸŽฉ๐Ÿฐ Python ๐Ÿ is a beginner-friendly programming language that is used by beginners and pros alike, everywhere from scientific computing and web development to machine learning, AI, and beyond!

So, let's start your coding journey, and don't worry, we'll go step by step. ๐Ÿšถโ€โ™‚๏ธ๐Ÿšถโ€โ™€๏ธ Buckle up! ๐Ÿš€

Why Python? ๐Ÿค”

Python stands out among other programming languages dueto its simplicity and readability. It makes the coder's life easier by eliminating the need for complicated syntax and boilerplate code. In simple terms, Python is like the friend who tells you, "Relax! Let's keep things simple!" ๐Ÿ˜ŠโœŒ๏ธ

What is Python? ๐Ÿคจ

Python is a Open source, general purpose, high level, and object-oriented programming language. It was created by Guido van Rossum. Python consists of vast libraries and various frameworks like Django,Tensorflow, Flask, Pandas, Keras etc.

Setting Up Python ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

First things first! We need Python installed on our machine. Here is a ๐Ÿ”—link to download Python directly from their official website. Choose the version that best fits your system, install, and we're ready to roll!

Python IDEs ๐Ÿ–ฅ๏ธ

An Integrated Development Environment (IDE) makes coding much smoother. Some popular Python IDEs are PyCharm, Jupyter Notebooks, or even simpler editors like Sublime Text and Atom. Choose your weapon of choice, and let's start coding! ๐ŸŽฏ๐Ÿ’ป

How to Install Python? ๐Ÿฑโ€๐Ÿ’ป

You can install Python in your System whether it is window, MacOS, ubuntu, centos etc. Below are the links for the installation:

Install Python on Windows

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11
python --version

Python Data Types ๐Ÿ“š

Python Data Types - javatpoint

In Python, we have several types of data:

  1. Numeric : You can use integers, floating-point numbers, and complex numbers. โœ…
integer = 10
print(integer, 'is of type', type(integer))
floating_point = 20.5
print(floating_point, 'is of type', type(floating_point))
complex_num = 1j
print(complex_num, 'is of type', type(complex_num))
  1. Dictionaries: Dictionaries are used to store data in key:value pairs. ๐Ÿ“–

     dictionary = {"name": "Python", "age": 30}
    
  2. Booleans: These represent one of two values: True or False. โœ”๏ธโŒ

     boolean_1 = True
     boolean_2 = False
    
  3. Set

    The Set is an unordered collection of unique items. Set is defined by values separated by commas inside braces { }.

     #Create a set named Student ID
     student_id = {111, 115, 113, 114, 110, 116, 117}
     #Display elements of it
     print(student_id)
     #Display Type of Student ID
     print(type(student_id))
    
  4. Sequences

    1. Strings: These are sequences of character data. Enclose them in single or double quotes. ๐Ÿ“œ

       string_1 = 'Hello, World!'
       print(string_1)
      
    2. Lists: These are collections of items (strings, integers, or even other lists). ๐Ÿ“

       list = ['apple', 'banana', 'cherry']
       print(list[0])
       print(list[2])
      
    3. Tuple: Tuple is an ordered sequence of items same as a list. The only difference is that tuples are immutable. Tuples once created cannot be modified.

      We use the parentheses () to store items of a tuple.

       #Create a Tuple
       product = ('Microsoft' , 'Linux-Ubuntu' , 'other')
       #Access Element at Numbber1
       print(product[0]) #It will print Microsoft
       print(product[1]) #It will print Linux-Ubuntu
      

Basic Operations in Python ๐Ÿงฎ

Python supports all the mathematical operations you would expect:

  • Addition (+)

  • Subtraction (-)

  • Multiplication (*)

  • Division (/)

  • Modulus (%)

# Store input numbers
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')
# Add two numbers
addition = float(num1) + float(num2) 
print(addition)
subtraction = float(num1) - float(num2)
print(subtraction)

Remember, Python is a powerful language but also very friendly to beginners. Start slow, practice daily, and soon you'll be doing incredible things with it! ๐ŸŽ†

So, keep calm and code Python! ๐Ÿ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Do remember, every programmer was once a beginner. ๐Ÿ’ก Keep your enthusiasm alive and never stop learning.

๐ŸŒˆ Happy Coding! ๐Ÿ’ป๐Ÿš€๐ŸŽˆ

ย