2023 2024 EduVark > Education Discussion > General Discussion


  #1  
September 2nd, 2015, 01:54 PM
Unregistered
Guest User
 
SET Python Example

I am software engineer and want to learn new programming language Python and want to know important codes of this language. Will you please explain about SET () function of Python language with example also tells me from where I can books of this language?
Similar Threads
Thread
Spoken Tutorials IIT Bombay Python
Python Bank of America
Python IIT Bombay
Bank of America Python Developer
IIT Bombay Python
Bank of America Python Quartz
Python Certification
Python Programming Training Course
Python training course
Python IITD

  #2  
January 8th, 2020, 10:05 AM
Unregistered
Guest User
 
Re: SET Python Example

I am doing CSE engineering degree and searching for details about the SET Python. Will you tell details about SET Python along with SET Python example also provide Python tutorial to get all details?
  #3  
January 8th, 2020, 10:08 AM
Super Moderator
 
Join Date: Oct 2019
Re: SET Python Example

SET Python

A set is an unordered collection of items. Every element is unique (no duplicates) and must be immutable (which cannot be changed).

Example

Create a Set:


thisset = {"apple", "banana", "cherry"}
print(thisset)

Script:

# set of integers
my_set = {1, 2, 3}
print(my_set)

# set of mixed datatypes
my_set = {1.0, "Hello", (1, 2, 3)}
print(my_set)

Add items:

Add Items
To add one item to a set use the add() method.

To add more than one item to a set use the update() method.

Example
Add an item to a set, using the add() method:

thisset = {"apple", "banana", "cherry"}

thisset.add("orange")

print(thisset)

Please find the below attached file for the Python tutorial:

Python tutorial




Attached Files
File Type: pdf Python tutorial.pdf (628.6 KB, 532 views)


Quick Reply
Your Username: Click here to log in

Message:
Options



All times are GMT +5. The time now is 03:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.6.0

1 2 3 4 5 6 7 8