Registry Synced

Jan 2026 - Python - Week 3 - GrPA 3 - Nested loops - GRADED

247 words
1 min read

Graded Assignment

Course: Jan 2026 - Python

Overview Question Test Cases Solution
GrPA 3 - Nested loops - GRADED
Submission deadline has passed for this assignment
Due Mar 04, 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
View details
10/10 Passed
Submitted on Mar 04, 2026 at 11:07 PM IST
Private Tests
View details
10/10 Passed
Submitted on Mar 06, 2026 at 10:43 PM IST
⏱️ 00:04 ✕
🔓 Unlock 📖 Ref 🔄 Reset
Python3
+ -
python
task = input()


if task == "permutation":
    s = input()
    for i in range(len(s)):
    for j in range(len(s)):
    if i != j:
    print(s[i] + s[j])

elif task == "sorted_permutation":
    s = input()
    for i in range(len(s)):
    for j in range(len(s)):
    if i != j and s[i] < s[j]:
    print(s[i] + s[j])

elif task == "repeat_the_repeat":
    n = int(input())
    for i in range(n):
    for j in range(1,n+1):
    print(j,end="")
    print()

elif task == "repeat_incrementally":
    n = int(input())
    for i in range(1,n+1):
    for j in range(1,i + 1):
    print(j,end="")
    print()

elif task == "increment_and_decrement":
    n = int(input())

    for i in range(1, n + 1):

    for j in range(1,i + 1):
    print(j,end="")

    for j in range(i - 1,0,-1):
    print(j,end="")
    print()
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.