From 34d633ebfa71c5e87fdb34a855fb12fcb034d5b6 Mon Sep 17 00:00:00 2001 From: Jeevika207 Date: Thu, 16 Oct 2025 09:36:42 +0530 Subject: [PATCH 1/5] Update Built-in Functions-Binary Conversion.md --- Built-in Functions-Binary Conversion.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Built-in Functions-Binary Conversion.md b/Built-in Functions-Binary Conversion.md index bedea1b87..eb4015c68 100644 --- a/Built-in Functions-Binary Conversion.md +++ b/Built-in Functions-Binary Conversion.md @@ -10,8 +10,16 @@ To write a Python program to convert the number **16** into its **binary represe ## 🧾 Program -Add Code Here +``` +a = 16 +b = bin(a) +print("Binary representation of", a, "is", b) +``` ## Output +image + ## Result + +Hence, the code is executed successfully, and the number **16** is converted into its **binary representation** `0b10000` using the built-in `bin()` function. From 06fede8b107006115e34981097b9cfa23a46813e Mon Sep 17 00:00:00 2001 From: Jeevika207 Date: Thu, 16 Oct 2025 10:01:12 +0530 Subject: [PATCH 2/5] Update Functions: Modulo Calculator.md --- Functions: Modulo Calculator.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Functions: Modulo Calculator.md b/Functions: Modulo Calculator.md index d32881f06..10a1f49eb 100644 --- a/Functions: Modulo Calculator.md +++ b/Functions: Modulo Calculator.md @@ -11,9 +11,20 @@ To write a Python program that defines a function which accepts two values and r 5. Call the `result` function with the user-provided values. ## 🧾 Program +``` +def result(a, b): + print("Modulo:", a % b) -Add code Here +num1 = int(input("Enter first number: ")) +num2 = int(input("Enter second number: ")) +result(num1, num2) +``` ## Output +image + + ## Result + +Hence, the code is executed successfully, and the function correctly computes and displays the **modulo** of the two input numbers. From b8abc91277a9804cd5b64784d81a82720dafd05d Mon Sep 17 00:00:00 2001 From: Jeevika207 Date: Thu, 16 Oct 2025 10:05:10 +0530 Subject: [PATCH 3/5] Update Lambda Function: Addition of Two Numbers.md --- Lambda Function: Addition of Two Numbers.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Lambda Function: Addition of Two Numbers.md b/Lambda Function: Addition of Two Numbers.md index 520cf0630..384029614 100644 --- a/Lambda Function: Addition of Two Numbers.md +++ b/Lambda Function: Addition of Two Numbers.md @@ -9,8 +9,20 @@ To write a Python program that defines a **lambda function** which takes two arg 3. Call the function with the user inputs and print the result. ## 🧾 Program -Add code here +``` +a = int(input("Enter first number: ")) +b = int(input("Enter second number: ")) + +f = lambda x, y: x + y +result = f(a, b) + +print("Sum:", result) +``` ## Output +image + ## Result + +Hence, the code is executed successfully, and the **lambda function** correctly computes and displays the sum of the two input numbers. From 3f04f7d6ae989edc2d6f61049aab4d758ce0e8e9 Mon Sep 17 00:00:00 2001 From: Jeevika207 Date: Thu, 16 Oct 2025 10:08:07 +0530 Subject: [PATCH 4/5] Update Looping(Patterns)-Pascal's Triangle Generator.md --- Looping(Patterns)-Pascal's Triangle Generator.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Looping(Patterns)-Pascal's Triangle Generator.md b/Looping(Patterns)-Pascal's Triangle Generator.md index 1a7dec6c3..27f489c36 100644 --- a/Looping(Patterns)-Pascal's Triangle Generator.md +++ b/Looping(Patterns)-Pascal's Triangle Generator.md @@ -27,9 +27,22 @@ To write a Python program that generates **Pascal's Triangle** using numbers. Th --- ## 🧪 Program -Add Code Here +``` +from math import factorial + +rows = int(input("Enter number of rows: ")) + +for i in range(rows): + print(" " * (rows - i), end="") + for j in range(i + 1): + print(factorial(i) // (factorial(j) * factorial(i - j)), end=" ") + print() +``` ## Sample Output +image + ## Result +Hence, the code is executed successfully, and the Pascal’s Triangle is generated correctly for the user-specified number of rows. From 0379ce9bfe1d8dc2e131c4c972efbbc265631ea0 Mon Sep 17 00:00:00 2001 From: Jeevika207 Date: Thu, 16 Oct 2025 10:12:58 +0530 Subject: [PATCH 5/5] Update Loops-Palindrome Number check.md --- Loops-Palindrome Number check.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Loops-Palindrome Number check.md b/Loops-Palindrome Number check.md index 15dd6d692..1ab5401e1 100644 --- a/Loops-Palindrome Number check.md +++ b/Loops-Palindrome Number check.md @@ -16,7 +16,24 @@ To write a Python program that checks whether a given number is a **palindrome** - Else, print that it is not a palindrome. ## 🧾 Program -Add code Here +``` +num = int(input("Enter a number: ")) +temp = num +rev = 0 + +while temp > 0: + rev = (10 * rev) + temp % 10 + temp = temp // 10 + +if rev == num: + print(num, "is a palindrome") +else: + print(num, "is not a palindrome") +``` ## Output +image + ## Result + +Hence, the code is executed successfully, and the program correctly checks whether the entered number is a palindrome.