In this program, we will take a string as input and reverse a string if its length is a multiple of 4
Steps to solve the program
- Take a list as input.
- If its length is divisible by 4 then reverse the string.
- Print the output.
#Input string
string = "sqatools"
if len(string) % 4 == 0:
print(string[::-1])
Output :
slootaqs