Adding strings and integer | Sololearn: Learn to code for FREE!


Adding strings and integer

Is it possible to add a string to an integer

6/10/2022 8:02:44 AM

Mayokun Timilehin

4 Answers

New Answer


Timilehin Mayokun "abc" + 12 = ?


If the string value is numeric (Like 2,4 etc) then yes.


Timilehin Mayokun Can you give an example if what you are trying to achieve. All letters have an underlying number, so it is possible to take the number associated with a letter, add a number to it, then convert it back to a letter. Therefore a + 3 = d That's how Caesar cypher works


For what you are trying this? In which language? Direct way is language dependent .. "ABC"+12 is valid in java but error in python..