Query Me ASK Latest My Queries

6

Answer

What's the Source code for this question in Python Programming language

We have two monkeys, a and b, and the parameters a_smile and b_smile indicate if each is smiling.

We are in trouble if they are both smiling or if neither of them is smiling.

Return True if we are in trouble.


monkey_trouble(True, True) → True

monkey_trouble(False, False) → True

monkey_trouble(True, False) → False

5 months ago by gouseferoz syed   

Technology

Answers

Print ("enter 1.smile 2.not smile)

a=int (input ("enter about first monkey "))

b=int (input ("enter about second monkey"))

If( (a==1 and b==1) or (a==2 and b==2)):

       Print ("we are in trouble")

Else:

   Print ("we are not in trouble")


5 months ago by Yamini Pokuru   


6

Found this helpfull

def smile_ornot(x,y):

if(x==y):

print("we are in trouble")

else:

print("we are safe")

print("enter 1 if u want a monkey to smile else enter 0 ")

a=int(input("wheter u want monkey1 to smile or not"))

b=int(input("wheter u want monkey2 to smile or not"))

smile_ornot(a,b)


5 months ago by srivani kanchibhotla   


1

Found this helpfull


5 months ago by Palanki Maneesha   


0

Found this helpfull

def monkey_trouble(a_smile,b_smile):

 if(a_smile==b_smile):

  return 'true'

 else:

  return 'false'

a=(input("enter a boolean value:"))

b=(input("enter a boolean value:"))

r=monkey_trouble(a,b)

if(r=='true'):

  print("we are in a trouble")

else:

  print("we are not in a trouble")

5 months ago by rupa solleti   


0

Found this helpfull

5 months ago by Sucharitha Prathi   


0

Found this helpfull

a=input("Is first monkey smiling(y/n):")

b=input("Is second monkey smiling(y/n):")

if (a=='y' and b=='y')or(a=='n' and b=='n'):

print("we are in trouble")

elif (a=='y' and b=='n')or(a=='n' and b=='y'):

print("we are not in trouble")

else:

print("invalid input") 

5 months ago by Rashida Farheen VK   


1

Found this helpfull