Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upB7/day2 #15
Open
B7/day2 #15
+92
−0
Conversation
Assignment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
SaurabhJambale commentedSep 5, 2020
#LIST
a=[1,2,3,4,5]
b=[4,3,2,1,6]
print(a,'\n')
print(b,'\n')
a.append(7)
print(a)
print(a[3])
index=4
a.insert(index,10)
print(a)
print(len(a))
print(a+b)
print(a*3)
print(a[2:4])
#Tuples
c=(1,2,3,4,5)
d=(7,8,9,10)
print(c[:2])
print(c*3)
print(c+d)
del(c)
print(3 in d )
print(5 in d)
#dictonaries
c={1:'JAN',2:'FEB',3:'MAR'}
print(c[1])
c[1]='FEB'
print(c)
c[1]='JAN'
print(1in c)
print('JAN' in c)
print(c)
print(c.get(3))
#SETS
empty_set=set()
nums = {1, 2, 1, 3, 1, 4, 5, 6}
print(nums)
nums.add(-7)
nums.remove(3)
print(nums)
first = {1, 2, 3, 4, 5, 6}
second = {4, 5, 6, 7, 8, 9}
print(first | second)
print(first & second)
print(first - second)
print(second - first)
print(first ^ second)
#STRINGS
str=('hello world')
print(str*3)
print(str+'welcome!')
print(str[3])
print(str[2:])
print(str[2:4])