Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that takes three numbers and prints their sum. Every number is given on a separate line. I am stuck on this problem.

image text in transcribedimage text in transcribed

Write a program that takes three numbers and prints their sum. Every number is given on a separate line.

I am stuck on this problem. I am getting 158 as an output and its still telling me I'm wrong. Am I missing anything? Any help would be greatly appreciated.

Instructions from your teacher: back to classroom run - run tests 1- # This program reads two numbers and prints their sum: 2 a = int(input ) 3 b = int(input) 4 print(a + b) Statement Write a program that takes three numbers and prints their sum. Every number is given on a separate line. 6 # Can you change it so it can read and sum three numbers? Example input 2 Example output 11 > a = int(-5) 3 b = int(180) ? c = int(-17) >print(a + b + c) 158 Theory If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ 3- details Failure reason: Output mismatch Teacher's input: -5 180 -17 Teacher expected to see: Your output: 158 175 Difference: 1758

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions