print("\t possiblity of getting heads or tails")
while True:
e=str(input("Enter the head or tail: "))
head=3
tail=3
head_only=1
tail_only=1
a=('ht, th, tt')
b=('hh, th, ht')
c=('tt')
d=('hh')
x=e
if x=='head':
print('The probability for getting head:',head)
print(b)
break
elif x=='tail':
print('The probability for getting tail:',tail)
print(a)
break
elif x=="tail_only":
print('The probability for getting tail only :',tail_only)
print(c)
break
elif x=="head_only":
print('The probability for getting head only:',head_only)
print(d)
break
Output: