14. Swap Cases: Hackerrank | Python Solution Explained

preview_player
Показать описание
In this tutorial, I am showing you how to easily and efficiently tackle this hackerrank challenge. The video will also teach you the fundamentals and necessary operations to achieve that.

#hackerrank #hackerranksolutions #pyhtonhackerrank #nestedlists
Рекомендации по теме
Комментарии
Автор

Hi there, I have been following your Hacherrank exercise videos and have started to be able to solve them on my own. Your explanations have helped me a lot, now I know how to tackle the challenges. thanks!

Btw, I find the structure of commands in Python very confusing, sometimes they are written as "sum(value)" or "my_list.sort()". The variable that is making the change can be inside the parenthesis and others before the command and with empty parenthesis. Is there any reason for it to be like it?

lucianag
Автор

I have one question, if we are using swapcase() method that can directly convert uppercase to lower and vice versa then what's the point to use for loop here??

can we use like this??

def swap_case(s):
return

if __name__ == '__main__':
s = input("Enter the String: ")
result = s.swapcase()
print("\nString after swap:", result)
print("\nString after reverse:", result[::-1])

khushbukeshari
Автор

i have a issue in parameter you set parameter in swap function s but used new_s
which is not in parameter sir plz explain that

mohammedbinmazi