Python code

Nagendra Reddy
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=” “)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response