158. Set Copy and Clear Method in Python with Example Code || Python Set Methods-3

Published: 11 October 2022
on channel: Bhavatavi
3
0

Code:
numbers={1,2,3,4}
new_numbers=numbers
new_numbers.add(5)
print(numbers)
print(new_numbers)


numbers={1,2,3,4}
new_numbers=numbers.copy()
new_numbers.add(5)
print(numbers)
print(new_numbers)
#clear()

vowels={'a','e','i','o','u'}
vowels.clear()
print(vowels)

set1={'welcome','to','python','course'}
print(set1)
set1.clear()
print(set1)


set1={'welcome','to','python','course'}
del set1
print(set1)


On this page of the site you can watch the video online 158. Set Copy and Clear Method in Python with Example Code || Python Set Methods-3 with a duration of hours minute second in good quality, which was uploaded by the user Bhavatavi 11 October 2022, share the link with friends and acquaintances, this video has already been watched 3 times on youtube and it was liked by 0 viewers. Enjoy your viewing!