I want results between 1-50 using python mathematically.

My code has a string of different characters every time.

I have to take a length and do some math so that results always comes between 1-50.

Currently, I am doing the same but only for 1-10.

my code looks like below:-

```
ans= 0
sum = 0
char=update1['headline']  # this is dynamic random char string 
sum=len(char)
ans= (sum % 10) + 1
print(ans)

```

How do I achieve that?