This is where I got stuck, trying to learn Python using web-course.
Write a program that takes a single input line of the form «number1»+«number2», where both of these represent positive integers, and outputs the sum of the two numbers. For example on input 5+12 the output should be 17.
We shouldn’t use split() or any import.
I think the solution is to use Character and its value of 43 and on that way substring but I am not sure. Only thing that I am sure is that solution is simple no fancy functions or imports needed.
Here is what i think might be close to solution
S = input()
for position in range(0,len(S):
#code for substrings 5 to number1, and 12 to number2
result = int(number1)+int(number2)
print(result)
Use
str.partition:If you can’t use
str.partitionand want to use aforloop, thenenumerateshould help: