0
What's wrong in my syntax?
print("what do you wish us to perform?" \n "1." + a + "-" + b + "OR" \n "2." + b + "-" + a I want the following output =》 What do you wish us to perform ? 1.a-b OR 2.b-a
5 Answers
+ 2
actually, you should simplify:
print("""What do you wish us to perform ?
1.a-b OR
2.b-a"""
+ 2
in that case:
print("what do you wish us to perform?\n1. " + a + "-" + b + "OR \n2. " + b + "-" + a)
+ 1
should include single quotes to display characters ('a'),use double quotes and + operator appropriately .
print("what do you wish us to perform? \n"+ "1." + 'a' + "-" + 'b' + " OR \n"+ "2." + 'b' + "-" + 'a');
+ 1
i wanted to display the character held by "a" and "b" so tried to do in that format
anyway thanks Frederic :)
+ 1
okay i shall try it Doc. Thank you for your help :)



