A Recap of Python

 Hello readers! I am posting on this blog after a long time and have decided to continue with Python. Since I have not written for a long time, I am using this post as a recap of all the topics covered previously in Python.

Let's begin-

1. Data Types

Data types are basically the type of data that can be stored in a variable. Python supports quite a few data types. The main data types supported by Python are-

a. Integer, (int):

The int data type stores an integer. For example;

  a=26
  print(type(a))

The output will show-

  <class 'int'>

b. Floating point, (float):

The float data type stores a decimal number. For example;

  b=14.98
  print(type(b))

The output will be-

  <class 'float'>

You can read more about numbers in Python here.

c. Text, (str):

The str data type stores text. For example;

  c='Hello'
  print(type(a))

The output will be returned as-

  <class 'str'>

d. List, (list):

The list data type stores a list of strings or numbers. For example;

  List=[1, 2.6, -45, 'Hello']
  print(type(List))

The output:

  <class 'list'>

You can find out more about lists in my two-part series here-
1. Python Lists Part-1
2. Python Lists Part-2


You can read more about data types in Python here and find in detail about Tuples in Python here.

That is all for now, but stay tuned for my future posts related to Python! Please give this blog a follow if you like the content and please drop a comment down below, expressing you views, doubts or suggestions regarding any topic.

Happy Coding,

Aarav Iyer

Aarav Iyer

I am a technology and programming enthusiast, currently a high school student. I also love drawing and am fairly interested in aeronautics and astrophysics. My favourite pastimes are reading books, blogging and skywatching with my telescope.

Post a Comment

Previous Post Next Post