0% found this document useful (0 votes)
109 views4 pages

Programming Assignment-2: Addition: (Https://swayam - Gov.in)

The document is about Programming Assignment-2 for the course "The Joy of Computing using Python" on NPTEL. It provides instructions for an assignment to write a Python program that takes two integer inputs and prints their addition. The assignment was due on February 13, 2020. Sample test cases and solutions are provided.

Uploaded by

Akshay Kharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views4 pages

Programming Assignment-2: Addition: (Https://swayam - Gov.in)

The document is about Programming Assignment-2 for the course "The Joy of Computing using Python" on NPTEL. It provides instructions for an assignment to write a Python program that takes two integer inputs and prints their addition. The assignment was due on February 13, 2020. Sample test cases and solutions are provided.

Uploaded by

Akshay Kharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

02/07/2020 The Joy of Computing using Python - Course

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

[email protected]

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » The Joy of Computing using Python (course)

Announcements (announcements)

About the Course (https://swayam.gov.in/nd1_noc20_cs35/preview) Ask a Question (forum)

Progress (student/home) Mentor (student/mentor)

Programming Assignment-2: Addition


Course Due on 2020-02-13, 23:59 IST
outline
In this assignment, you will have to take two numbers (integers) as input and
print the addition.
How does an
NPTEL online Input Format:
course work?
The first line of the input contains two numbers separated by a space.
Week 0
Output Format:
Week 1
Print the addition in single line
Week 2
Example:
Introduction to
Anaconda
(unit?
Input:
unit=20&lesson=21) 42
Installation of Output:
Anaconda
6
(unit?
unit=20&lesson=22)
Explanation:
Introduction to Since the addition of numbers 4 and 2 is 6, hence the output is 6.
Spyder IDE
(unit? Sample Test Cases
unit=20&lesson=23) Input Output
Printing 11 12 23
Test Case 1
statements in
Python (unit?
unit=20&lesson=24) Test Case 2 200 300 500

Understanding
Variables in

https://onlinecourses.nptel.ac.in/noc20_cs35/progassignment?name=269 1/4
02/07/2020 The Joy of Computing using Python - Course

Python (unit?
unit=20&lesson=25) Test Case 3 4 4 8

Executing a
Test Case 4 1 2 3
sequence of
instructions in
the Console Test Case 5 6 2 8
(unit?
unit=20&lesson=26)
Test Case 6 10 10 20
Writing your
First Program Test Case 7 12 13 25
(unit?
unit=20&lesson=27)
Test Case 8 3 5 8
Taking inputs
from the user
(unit? The due date for submitting this assignment has passed.
unit=20&lesson=28) As per our records you have not submitted this assignment.
Sample solutions (Provided by instructor)
Discount
Calculation
1 x,y = input().split(" ")
2 x = int(x)
(unit? 3 y = int(y)
unit=20&lesson=29) 4
5 print(x+y)
Motivation to if
condition (unit?
unit=20&lesson=30)

A reminder on
how to deal
with numbers
(unit?
unit=20&lesson=31)

Understanding
if condition's
working (unit?
unit=20&lesson=32)

Realizing the
importance of
syntax and
indentation
(unit?
unit=20&lesson=33)

Introductions to
loops (unit?
unit=20&lesson=34)

Loops: Sum of
numbers (unit?
unit=20&lesson=35)

Loops: Sum of
numbers
(continued)
(unit?
unit=20&lesson=36)

Loops:
Multiplication

https://onlinecourses.nptel.ac.in/noc20_cs35/progassignment?name=269 2/4
02/07/2020 The Joy of Computing using Python - Course

Tables (unit?
unit=20&lesson=37)

Introduction to
While Loop
(unit?
unit=20&lesson=38)

Quiz :
Assignment 2
(assessment?
name=261)

Programming
Assignment-1:
Introduction to
Online Portal
(/noc20_cs35/progassignment?
name=268)

Programming
Assignment-
2: Addition
(/noc20_cs35/progassignment?
name=269)

Programming
Assignment-3:
Small
(/noc20_cs35/progassignment?
name=270)

Week 2
Feedback
(unit?
unit=20&lesson=271)

Week 3

week 4

Week 5

Week 6

Week 7

Week 8

Week 9

Week 10

Week 11

Week 12

Text Transcripts

https://onlinecourses.nptel.ac.in/noc20_cs35/progassignment?name=269 3/4
02/07/2020 The Joy of Computing using Python - Course

Download
Videos

Books

https://onlinecourses.nptel.ac.in/noc20_cs35/progassignment?name=269 4/4

You might also like