N=3
sum=0
for i in range(1,N+1):
sum+=pow(i,i)
print(sum)
What is PIP ?
Given the following Python code:
mylist=[5,4,3,"hi"]
mylist=sorted(mylist)
print(mylist)
How to get the last element of the list in python? Suppose we have a list with name arr, contains 5 elements.
What will be the output of the following Python code?
nums = set([1,1,2,3,3,3,4,4])
print(len(nums))
What will be the output of the following Python code?
l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
What will be the output of the following Python code snippet?
print([if i%2==0: i; else: i+1; for i in range(4)])
Is the following Python code valid?
>>> a=(1,2,3,4)
>>> del a
Find the output of the following code:
q={'digit':4,'decimal':1.2,'value':24}
q.update({'digit':5})
print(q)
q['decimal']=1.3
q['value']=25
If a={5,6,7}, what happens when a.add(5) is executed?