Skip to content

Spoke Right

Education for everyone

https://spokeright.com
Primary Menu
  • Home
  • Our Services
    • Translation
    • Interpretation
    • Transcription
    • Voice-Over
    • Proofreading
    • Content writing
  • Free Education
    • Learn Android Studio
    • Learn Python
    • Learn MongoDB
    • Learn MySql
    • Learn React
    • Montessori Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
    • TicTac
    • Checkers
    • Foosball
    • Billiards
    • Master Chess
    • Logic Game
  • Contact Us
Download Now
  • Home
  • Learn Python
  • What are Python literals
  • Learn Python

What are Python literals

Spoke Right December 1, 2022 1 min read

Python literals

Literals are the constant values or the variable values used in a Python code. There are mainly five types of literals used in PYTHON:

  • String Literals
  • Numeric Literals
  • Boolean Literals
  • Special Literals
  • Collection Literals

String literals:

In Python, String literals are characterised either by single quotation marks, or double quotation marks surrounding them. The string literals can be Single line or Multiple line strings.

Numeric literals:

Numeric Literals in Python can be of three numeric types:

  1. int
  2. float
  3. complex

1. Int

Int can be defined as a collection of both positive and negative integers (without decimals).

2. Float

Float can be defined as a collection of both positive and negative floating point numbers (with decimals) along with the scientific numbers with an “e” to indicate the power of 10.

3. Complex

Complex numbers are the numbers having both a real and imaginary part in the form of x +yj, where x is real and y is imaginary.

Boolean literals:

Boolean literals can be either 0 or 1 i.e, either True or False.

 Special literals.

None is a special literal defined in Python to specify the end of a list or to represent a NULL value.

Literal Collections.

Beside Lists, Python supports Tuples and Dictionary to store a collection of literals in a single variable.

Continue Reading

Previous: How do you identify an identifier in Python
Next: What are operators in Python

Related Stories

What is Data Statistics And Analysis With Java And Python
9 min read
  • Learn Python

What is Data Statistics And Analysis With Java And Python

December 7, 2022
How do I get the date in Python
2 min read
  • Learn Python

How do I get the date in Python

December 7, 2022
What is an exception handler in Python
2 min read
  • Learn Python

What is an exception handler in Python

December 7, 2022

This AD Will support Us

Support Us

Coding Ustad LTD Support
Coding Ustad LTD Support

Coding Ustad LTD

Coding Ustad LTD
Coding Ustad LTD

Recent Posts

  • How to Install Node.js and npm on CentOS 7
  • How to Install Node.js and npm on CentOS 7
  • How to Install CentOS Web Panel (CWP) on CentOS 7
  • The Power of Marketing in Real Estate: A Guide to Boost Your Business
  • Vehicle Verification in Pakistan

Get free Hosting

Hostens.com - A home for your website

You may have missed

How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 3, 2023
How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 2, 2023
How to Install CentOS Web Panel (CWP) on CentOS 7
3 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install CentOS Web Panel (CWP) on CentOS 7

May 2, 2023
The Power of Marketing in Real Estate: A Guide to Boost Your Business https://thaikadar.com/secureinvestment/
2 min read
  • Article By Spoke Right
  • Blog By Spoke Right
  • Circular Byte Private Limited

The Power of Marketing in Real Estate: A Guide to Boost Your Business

January 30, 2023
  • Home
  • Our Services
  • Free Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
  • Contact Us
Copyright © All rights reserved. | MoreNews by AF themes.