Python Programming - Free Ebook
Python Programming - Free Ebook
Python
Data Science
But the best part of python is its easiness. Let’s learn the basics of python, so you can start your 5 Amazing Dat a Science Project Ideas
For College St udent s
journey. Pyt hon: Top 3 Reasons You Should Learn
Pyt hon Now
1 Install Python
2 Install PyCharm
4 Data Types
Back To Top
5 Variables
6 How to Print in Python
7 User Input
8 Loops
9 Functions
10 Calling a Function
TOPICS
Artificial Intelligence
Big Data
Blockchain
python
Cloud
Once you have installed python, you need an editor to write codes and execute your programs.
Data Science
There are various editors to choose from. But we are going to go with PyCharm.
Jobs
Startups News
You can install PyCharm from its official site .
T rending
PyCharm
WE ARE CONSOLE FLARE.
Click On PyCharm that you have just downloaded, A pop-up window will appear.
Back To Top
Visit www.consoleflare.com
Back To Top
Now that you know how to run PyCharm, Let’s dive into the basics of Python.
Data Types
Python offers a lot of data types such as :
integer (int)
f loat (f loat)
string (str)
boolean (bool)
list (list)
sets (set)
tuples (tuple)
dictionary (dict)
Variables
You do not need to declare variables before using them or declare their type.
age = 25
Here age is a variable that is assigned a value 25. So the data type of age is an integer.
print(age)
integer (int) :
Any number positive or negative with no decimal value is integer data type.
Back To Top
1,2,-1,-198
To convert any a value to an integer data type we use int() function
int(‘123’)
float (float) :
Any number positive or negative with a decimal value is a float data type.
1.5,2.4,-1.3,-198.45
float(‘123’)
string (str) :
To convert any value to string data type we use the str() function.
str(123)
boolean (bool) :
True , False
To convert any a value to boolean data type we use the bool() function
bool(1)
lists (list) :
List is a collection of values of different data types enclosed within square brackets [].
[1,2,3,4,5,98,5]
Sets (set) :
Set is a collection of unique values of different data types enclosed within curly brackets {}.
{1,2,56,78}
Tuples (tuple) :
Tuple is a collection of values of different data types that cannot be changed enclosed within
curly brackets ().
(1,2,56,78)
Dictionary (dict) :
Dictionary is a collection of key : value pair enclosed within curly brackets {}.
Back To Top
User Input
To take input from user, we use input() function in python. Let’s do a simple program to
understand use of input.
input() function always takes input from user in string data type, so we need to convert values
code
Loops
Loops are used to perform repetitive action.
for i in range(3):
print(‘medium’)
Back To Top
Functions
Functions are piece of code that does a particular task. To define a function in Python, we
use def keyword.
def funcname(parameters):
statements
For example , let’s say we want to create a function to add two numbers:
def add(x,y):
print(x+y)
Calling a Function
add(3,2)
When you are learning a programming language, your goal must be clear.
Why do you want to learn this programming language ? What you will be doing after you master
this language ? You must find a reason to learn this language. Every language has one application
that surpasses other.
Python , now a days , is used for Data Science. Data Science , not to tell, is a booming field. You
can go through this article to know salary trends for Data Scientists in India.
If you want to put your python knowledge to best use, Apply it in Data Science. To learn Data
Back To Top
We also provide webinars for you to join and know more about Data Science.
You can connect to us at ConsoleFlare and Become a Data Scientist in just 5 Months.
Console Flare
Websit e
ht t p://www.consoleflare.com
Elon Musk Buys T witter at Whopping $44Bn Why Elon Musk Spent Whopping 44 Billion T o Buy T witter
— T he Real Reason
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Post Comment
Back To Top
RELATED POSTS
©2022 Console Flare | A Product of Arbre Creations Pvt. Ltd. | Theme: Color Blog by Mystery Themes. Become a Data Scientist
Back To Top