Python Unveiled: A Beginner's Odyssey into the World of Coding Magic

Python Unveiled: A Beginner's Odyssey into the World of Coding Magic

Installation:

?

  1. Visit the official Python website: https://www.python.org/downloads/windows/
  2. Click the appropriate link for your system to download the executable file: Windows installer (64-bit) or Windows installer (32-bit).
  3. Run that downloaded executable installer file. For example, python.exe file.
  4. Click Install to start the installation.
  5. After the installation is complete, a Setup was successful message is displays.
  6. To verify python installation:

Enter the code:? python --version

?

  1. Now you are ready to start learning and programming in Python.

?

Quick Summary:

?

Python has syntax that allows developers to write programs with less lines than some other programming languages. Python runs on an interpreter system. Python is a computer programming language often used to build websites and software, applications ,conduct data analysis.

?

Targeted Audience:

?

This article is intended for those people interested in learning the fundamentals of python development. It will be useful for freshers, backend developers, students. and for those who are lazy to write lengthy code because python has easy, simple syntax which includes short code.

?

Use Cases:

?

·??????? Web development -framework: Django, Flask, FastAPI, etc.

·??????? Data analysis - Pandas, NumPy

·??????? Game development - Pygame

·??????? Education and teaching programming concepts

?

Let’s see what Python is:

?

Definition:

§? Python is a high-level, general-purpose, interpreted object-oriented programming language and it is used to build websites and software.

§? Python code tends to be short and when compared to compiled languages like C and C++, it executes programs slower.

?

Features:

  1. Easy to Learn and Use:

§? Python is easy to learn and simple as compared to other languages. Its syntax is straightforward.

§? There is no use of the semicolon or curly-bracket in syntax.

§? It is the most suggested programming language for beginners.

  1. Interpreted Language:

§? Interpreted means program executes single line at a time.

§? The advantage of being interpreted language, makes it debugging easy and portable.

  1. Expressive Language:

§? For Ex.: If you want to print small program you simply type print ("Hello World"). It will take only single line to execute, while Java or C takes multiple lines.

  1. Free and Open Source:

§? Python is freely available for everyone. open-source means, "Anyone can download its source code without paying a single rupee.

  1. Object-Oriented Language:

§? Python supports object-oriented language and concepts of classes and objects. It supports inheritance, polymorphism, and encapsulation, etc.

?

Syntax:

?????????????? demo.py :- File name

How to run python file:

?????????????? python myfile.py??????? // here my myfile is name of program.

Python Comments:

§? Comments are often used to explain Python code. "#" used for commenting.

§? For Ex:? # Printing hello world

Variables:

  • Variables are like containers it stores data values.
  • For Ex:?? x = 5???????????????? //x is a variable

Data Types:

String:?? In String datatype, we can store string values.

int:???????? In int datatype, we can store int values.



float:???? In float datatype, we can store float values.

list:???????? lists are always stored in square brackets [ ] .

tuple:???? tuples are always stored in round brackets ( ) .

dict:?????? In Dictionaries, we store key value pair.

Function:

§? A function is a reusable block of code? that performs some specific tasks. it only runs when it is called.

§? You can pass data, known as parameters in a function.

§? here : demo_function is function name. It can be anything.

Arrays:

§? Arrays are used to store multiple values but with the same datatype.

§? To check length of an array

?

§? To add elements in array we use append method. For ex.: animal.append("fox")

?

§? To delete elements in array we use pop method. it deleteindex wise.For Ex:animal.pop(1)

?

§? Removes all the elements from the list. Method:- clear()

?

§? Returns the number of elements with the specific value. Method: count()

§? It will return index value of 4 that is 1.

?

§? Adds an element at the specified position.Method:- insert()


§? Removes the first item with the given value. Method: remove()

?

§? Reverses the order of the list. Method: reverse()


§? Sorts the list. Method: sort()


?

Class:

§? Class is a blueprint of an object.

§? It defines the structure and behavior of objects of that class.

§? The class keyword is used to define a class.


?

Object:

§? An object is an instance of a class and a collection of attributes and methods.

§? For ex.: x = Person("ram", 20)


?

Inheritance:

§? Inheritance is a OOP concept that allows you to create a new class based on an existing class. The new class inherits attributes and methods from the existing class, which is referred to as the base or parent class. The newer class is called the derived or child class of the base class.

?

Polymorphism:

§? polymorphism means having many forms.

?

1.????? Method Overloading (Compile-Time Polymorphism):

§? having same name but different parameters.

2.????? Method Overriding (Run-Time Polymorphism):

§? having same name and same parameters.

?

Encapsulation:

§? simple lang. wrapping or hiding of data.

§? object has ability to hide data and behavior that is not necessary to use.

?

How to take User Input: For ex.

Closing Thought:

Python is a powerful and versatile programming language that has become an integral part of the technology. Everyone is using Python because of its simple syntax, and if you are a beginner, you should definitely go with python.

?

Credit – Priyanka Divekar (Backend Team)

?

MetricsViews Pvt. Ltd.

MetricsViews specializes in building a solid DevOps strategy with cloud-native including AWS, GCP, Azure, Salesforce, and many more.? We excel in microservice adoption, CI/CD, Orchestration, and Provisioning of Infrastructure - with Smart DevOps tools like Terraform, and CloudFormation on the cloud.

www.metricsviews.com

要查看或添加评论,请登录

MetricsViews Private Limited的更多文章

社区洞察

其他会员也浏览了