Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8477903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:35:45+00:00 2026-06-10T18:35:45+00:00

This is where I got stuck, trying to learn Python using web-course. Write a

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:35:47+00:00Added an answer on June 10, 2026 at 6:35 pm

    Use str.partition:

    line = raw_input()
    num1, _, num2 = line.partition('+')
    print(int(num1) + int(num2))
    

    If you can’t use str.partition and want to use a for loop, then enumerate should help:

    for i, c in enumerate(line):
        if c == '+':
            # what goes here?
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn iOS (4.3) programming and got stuck on this. I'm using
its when i starting trying implementing this that i got quite stuck. some business
I'm trying to learn Lisp but I got stuck by this example (you can
I'm writing a Python program for fun but got stuck trying to import a
I'm stuck for 3 days on this. I got a Dicom files that i
I was trying this script from a pdf file.I got stuck where the target
I'm trying to learn reverse engineering, and I'm stuck on this little thing. I
Got stuck while trying to make an element in website behave like this: <div
I am trying to learn backbone.js through the following example. Then I got stuck
I'm trying out expression trees in C# and just got stuck with something that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.