Please convert the following C code to Python so that the Python program executes successfully passing the test cases.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str[101];
int len, X;
scanf("%s%nn%d", str, &len, &X);
printf("%s",str+len-X);
return 0;
}
converting the above code to python
string=input()
x=int(input())
print(string[len(string)-x::])