Neural Sync Active
Jan 2026 - Python - Week 6 - Strings 3 - Graded
Registry Synced
Jan 2026 - Python - Week 6 - Strings 3 - Graded
470 words
2 min read
Graded Assignment
Course: Jan 2026 - Python
Strings 3 - 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:27 PM IST
Private Tests
3/3 Passed
Submitted on Mar 25, 2026 at 2:27 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.
Palindrome Integer**
Given an integer, check whether it is a palindrome. A palindrome is a number or a string that reads the same backward as forward.
Assume the numbers are positive.
Example
pythonis_palindrome(121) == True is_palindrome(123) == False is_palindrome(1212) == False
Template Code(Click to Expand)
def is_palindrome(n: int) -> bool: '''Checks if an integer is a palindrome. Arguments: n: int - the integer to check Return: bool - True if the integer is a palindrome, False otherwise ''' ...
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:
textis_equal(is_palindrome(121), True)
Expected Output:
textTrue
Actual Output:
textTrue
Case 2
Input:
textis_equal(is_palindrome(123), False)
Expected Output:
textFalse
Actual Output:
textFalse
Case 3
Input:
textis_equal(is_palindrome(-121), False)
Private Tests ( 3/3 )
Case 1
Input:
textis_equal(is_palindrome(0), True) is_equal(is_palindrome(9), True)
Expected Output:
textTrue True
Actual Output:
textTrue True
Case 2
Input:
textis_equal(is_palindrome(1001), True) is_equal(is_palindrome(12321), True) is_equal(is_palindrome(12345), False)
Expected Output:
textTrue True False
Actual Output:
textTrue True False
Case 3
Input:
textis_equal(is_palindrome(123456), False) is_equal(is_palindrome(1232123), False) is_equal(is_palindrome(78900987), True)
Expected Output:
textFalse False True
Actual Output:
textFalse False True
💻 IITM Official Solution
pythondef is_palindrome(n: int) -> bool: '''Checks if an integer is a palindrome. Arguments: n: int - the integer to check Return: bool - True if the integer is a palindrome, False otherwise ''' return str(n) == str(n)[::-1]
💻 My Submitted Code
pythondef is_palindrome(n: int) -> bool: '''Checks if an integer is a palindrome. Arguments: n: int - the integer to check Return: bool - True if the integer is a palindrome, False otherwise ''' ... if n < 0: return False s=str(n) return s == s[::-1]