Python code
Mar 17, 2022
def say_hello(name):
return(“Hello,” + name + “!” )
say_hello(nagendra”);
— — — — — — — — — — — — — —
def my_func(st):
operations = (str.lower, str.upper)
return ‘’.join(operations[i%2](x) for i, x in enumerate(st))
>>> my_func(‘nagendra’);
‘nAgEnDrA’
— — — — — — — — — —
list1 = [5,6,7,8]
for num in list1:
# checking condition
if num % 2 == 0:
print(num, end=” “)