Sunday, August 1, 2021

Core-python for probability of getting tail and head.

 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:




USD TO INR C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                                                 POLLACHI-642001                                     ...