Telegram Group & Telegram Channel
Difference between list and tuple in python

🔸List is mutable ( you can modify the original list) and it's values are written in sqare brackets [ ]

🔸Tuple is immutable ( you can't modify it) and it's values are written in parentheses ( ) delimited by comma( , )

🔸To convert list to tuple - we use tuple() function
list1 = [1,2,3]
print(tuple(list1)) Output : (1,2,3)

🔸 For single element list
list1 = [1]
print(tuple(list1)) Output : (1, )

▪️a tuple is a tuple because of comma not because of parentheses


@Python_Codes



tg-me.com/python_codes/224
Create:
Last Update:

Difference between list and tuple in python

🔸List is mutable ( you can modify the original list) and it's values are written in sqare brackets [ ]

🔸Tuple is immutable ( you can't modify it) and it's values are written in parentheses ( ) delimited by comma( , )

🔸To convert list to tuple - we use tuple() function
list1 = [1,2,3]
print(tuple(list1)) Output : (1,2,3)

🔸 For single element list
list1 = [1]
print(tuple(list1)) Output : (1, )

▪️a tuple is a tuple because of comma not because of parentheses


@Python_Codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/224

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.Python Codes from ua


Telegram Python Codes
FROM USA