Python_QnA_Fixed
Python_QnA_Fixed
c = 10
def add():
global c
c=c+2
print(c, end='#')
add()
c = 15
print(c, end='%')
Output: 12#15%
Explanation:
L1.count(4) - Count 4s in L1
L1.sort() - Sort L1
L2.reverse() - Reverse L2
import random
a = 'Wisdom'
b = random.randint(1,6)
for i in range(0,b,2):
print(a[i], end='#')
b ranges from 1 to 6
def swap_first_last(tup):
if len(tup) < 2:
return tup
return new_tup
result = swap_first_last((1,2,3,4))
def find_cmail():
if '@cmail' in word:
print(word)
def long_words():
Python Programming Questions and Answers
if len(word) > 5:
print(word)
print(row)