How To Repeat Objects In A Python 3 Tuple

Опубликовано: 30 Сентябрь 2024
на канале: Daily dose of America
1,300
22

Be sure to like, share and comment to show your support for our tutorials.

=======================================
Channel - https://goo.gl/pnKLqE
Playlist For This Tutorial - https://goo.gl/EyZFti
Latest Video - https://goo.gl/atWRkF
Facebook -   / mastercodeonline  
Twitter - https://twitter.com/mastercodeonlin?l...
Website - http://mastercode.online
======================================

Repeating data in a Python Tuple is pretty straight but there is some important information you must remember when working with immutable objects in Python. First off we are never changing the original tuple instead we are actually creating a new Python tuple. With that being said we are not saving our newly created tuple either so we have to assign a variable to represent the tuple.

We repeat the data in a Python tuple by using the asterisks or the multiplication operator. This will allow us to repeat the data in the tuple. This is similar to how we repeated strings and list.

If you have any questions about repeating data in a Tuple leave a comment below and we will help you out.