+ 2
Hi. Can someone please correct this code for me: print ('The sum is' 1 + 2)
I need the output to be: The sum is 3
4 Answers
+ 1
print('The sum is', 1+2)
+ 1
Thank you Jayakrishnađźđł
+ 1
You can do in other ways :
print('The sum is', 1+2) #printing multiple values by space separated
print('The sum is '+str(1+2)) #forming a string and printing. Because str+int is error.. Not allows
print(f'The sum is {1+2}') #farmatted string
You're welcome...K Deshpande
+ 1
That's really helpful Jayakrishnađźđł