{"id":17324,"date":"2021-08-26T10:42:42","date_gmt":"2021-08-26T05:12:42","guid":{"rendered":"https:\/\/python-programs.com\/?p=17324"},"modified":"2021-11-22T18:37:11","modified_gmt":"2021-11-22T13:07:11","slug":"python-program-to-determine-whether-one-string-is-a-rotation-of-another","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-determine-whether-one-string-is-a-rotation-of-another\/","title":{"rendered":"Python Program to Determine Whether one String is a Rotation of Another"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Shuffle a List<\/a>
\nGiven a string, and the task is to determine whether one string is a rotation of another.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"btechgeeks\"\r\nGiven second string = \"geeksbtech\"<\/pre>\n

Output:<\/strong><\/p>\n

The given second string is the rotation of the given second string<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"pqrst\"\r\nGiven second string = \"sggsf\"<\/pre>\n

Output:<\/strong><\/p>\n

The given second string is not the rotation of the given second string<\/pre>\n

Program to Determine Whether one String is a Rotation of Another<\/h2>\n

Below are the ways to determine whether one string is the rotation of another.<\/p>\n