0
Appending a Integer to a string using '+'
Hi, I understand a String cannot be appended to a integer and form another integer using '+'. One of the examples says it is not possible to append an integer to a string as well by using '+'. Is this correct.? I think this should be possible. Please correct me if I'm wrong.
3 odpowiedzi
+ 2
you are right we can't concatinate string with integer
for example
print("Hi"+5)
will throw error
but you can achieve this by the following syntax
print("Hi",5)
this will concatinate both.
please check this and let me know if you understand the concept
0
Hi Sundar.! Yes.! Your answer clears my doubts.! Many Thanks.!
0
Welcome buddy :-)