Write a program to print the sum of two numbers. If no number is input by the user, the program should use the "break" syntax of Python and terminate.

AnswerBot
2y

Program to print addition of two numbers with break syntax if no input.

  • Use input() function to take user input

  • Use try-except block to handle errors

  • Use while loop to keep taking input until break is en...read more

kunal roy
1y
while True: try: number1= int(input("Enter your first number :")) number2= int(input("Enter your first number :")) break except ValueError: print("Oops!! you got the wrong numbers...") sum=number1+num...read more
Help your peers!
Select
Add answer anonymously...

TCS Assistant System Engineer Trainee interview questions & answers

An Assistant System Engineer Trainee was asked 2w agoQ. What is exception handling?
An Assistant System Engineer Trainee was asked 2w agoQ. What is OOPS and what are its pillars?
An Assistant System Engineer Trainee was asked 1mo agoQ. What is the method to count the number of words in a given string?

Popular interview questions of Assistant System Engineer Trainee

An Assistant System Engineer Trainee was asked 1w agoQ1. Explain OOP concepts.
An Assistant System Engineer Trainee was asked 2w agoQ2. What is exception handling?
An Assistant System Engineer Trainee was asked 2w agoQ3. What is OOPS and what are its pillars?

Top HR questions asked in TCS Assistant System Engineer Trainee

An Assistant System Engineer Trainee was asked 1mo agoQ1. What will you do if you encounter any problem?
An Assistant System Engineer Trainee was asked 3mo agoQ2. Can you provide a brief introduction about yourself?
An Assistant System Engineer Trainee was asked 5mo agoQ3. Are you open to relocating for this position?
TCS Assistant System Engineer Trainee Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits