Help me in solving PYTH12 problem

My issue

print(7 “plus” 3, “equals”, 10) whAT IS MY MISTAKE tell me in deep

My code

# Add "equals" and 10 at the place of __, __

print(7 "plus" 3, "equals", 10)

Learning course: Learn Python Programming
Problem Link: https://www.codechef.com/learn/course/rcpit-python/RCPITPY03/problems/PYTH12

2 Likes

Add “equals” and 10 at the place of __, __

print(7, “plus”, 3, “equals”, 10)

i think this will make sense. 7 is int and ‘plus’ is string and they want to be separated by ‘,’

2 Likes

print(7,“plus”,3,“equals”,10) Add comma between 7 and plus because 7 is a int and plus is string

print(7,“plus”,3,“equals”,10)
you not comma

INSANE

either make it all string use plus or give comma after every integer and string
print(7 ,“plus” ,3 ,"equals ", 10 )
print("7 " +"plus "+ "3 "+"equals "+ "10 ")

Syntax Error:

  • In print(7 "plus" 3, "equals", 10), you are not using a valid way to separate elements inside print().
  • "plus" is not properly connected with 7 and 3. Python does not allow implicit concatenation like that without an operator.

print(str(7) + " plus " + str(3) + " equals " + str(10))