March 15, 2024, 8:33 a.m. | Sachin

DEV Community dev.to

You must have seen the asterisk or star symbol inside the parameterized function or used it to perform mathematical or other high-level operations.


We'll look at the different ways the asterisk(*) is used in Python in this article.


Asterisks(*) are used in the following situations:



  • Exponentiation and multiplication


  • Unpacking/Packing


  • Repetition


  • Formatting Strings


  • Tuple and Set Unpacking



Let's begin by breaking down the use of asterisks in the above cases one by one.





Multiplication


Python has arithmetic operators, one of which …

article function inside look operations python star strings

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York