Registry Synced

Jan 2026 - Python - Week 6 - Numbers 1 - Graded

559 words
3 min read

Graded Assignment

Course: Jan 2026 - Python
Numbers 1 - Graded
Submission deadline has passed for this assignment
Due Mar 25, 2026 at 11:59 PM IST
Instructions
Use "Test Run" to verify your code with public test cases.
Press "Submit" to have your assignment evaluated.
You can submit your assignment multiple times up until the deadline.
Make sure to submit your final code by the deadline to receive your score.
Summary
100 out of100
Score
Public Tests
3/3 Passed
Submitted on Mar 25, 2026 at 2:20 PM IST
Private Tests
3/3 Passed
Submitted on Mar 25, 2026 at 2:20 PM IST

Change in eligibility criteria to write oppe2 exam: A5>=40/100 AND A6>=40/100 AND A7>=40/100 AND A8>=40/100. and becoming eligible to give the end term exam.
Find percentage increased
Write a function to calculate the percentage increase from the original value to the new value.
Assume original is less than or equal to new.
Examples
python
>>> percentage_increased(50, 75)
50.0
>>> percentage_increased(80, 100)
25.0
Template Code(Click to Expand)

def percentage_increased(original, new):
    '''Calculate the percentage increase from the original value to the new value.

    Assume original is less than or equal to new.

    Args:
        original (float): The original value.
        new (float): The new value.

    Returns:
        float: The percentage increase.

    Examples:
    >>> percentage_increased(50, 75)
    50.0
    >>> percentage_increased(80, 100)
    25.0
    '''
    ...

NOTE: You can use the below tools for working out and debugging. Click to open them in new tab.

Public Tests ( 3/3 )

Case 1

Input:
text
is_equal(
    round(percentage_increased(50, 75)),
    50
)
Expected Output:
text
50
Actual Output:
text
50

Case 2

Input:
text
is_equal(
    round(percentage_increased(80, 100)),
    25
)
Expected Output:
text
25
Actual Output:
text
25

Case 3

Input:
text
is_equal(
    round(percentage_increased(80, 80)),
    0
)
Expected Output:
text
0
Actual Output:
text
0

Private Tests ( 3/3 )

Case 1

Input:
text
is_equal(
    round(percentage_increased(100, 100)),
    0
)
is_equal(
    round(percentage_increased(1, 1.5)),
    50
)
Expected Output:
text
0

50
Actual Output:
text
0

50

Case 2

Input:
text
is_equal(
    round(percentage_increased(100, 105)),
    5
)
is_equal(
    round(percentage_increased(5, 15)),
    200
)
Expected Output:
text
5

200
Actual Output:
text
5

200

Case 3

Input:
text
is_equal(
    round(percentage_increased(40, 50)),
    25
)
is_equal(
    round(percentage_increased(200, 260)),
    30
)
Expected Output:
text
25

30
Actual Output:
text
25

30

💻 IITM Official Solution

python

def percentage_increased(original, new):
    '''Calculate the percentage increase from the original value to the new value.

    Assume original is less than or equal to new.

    Args:
        original (float): The original value.
        new (float): The new value.

    Returns:
        float: The percentage increase.

    Examples:
    >>> percentage_increased(50, 75)
    50.0
    >>> percentage_increased(80, 100)
    25.0
    '''

    return ((new - original)*100)/original


💻 My Submitted Code

python

def percentage_increased(original, new):
    '''Calculate the percentage increase from the original value to the new value.

    Assume original is less than or equal to new.

    Args:
        original (float): The original value.
        new (float): The new value.

    Returns:
        float: The percentage increase.

    Examples:
    >>> percentage_increased(50, 75)
    50.0
    >>> percentage_increased(80, 100)
    25.0
    '''
    ...

    increase = new - original
    if original == 0:
        return 0.0 if new == 0 else float('inf')

    percentage = (increase / original) * 100

    return float(percentage)

Document Outline
Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.