From 8086e71c2af42b91b7430116210f7742b124f484 Mon Sep 17 00:00:00 2001 From: 24900452 Date: Tue, 29 Apr 2025 11:27:25 +0530 Subject: [PATCH 1/6] Update Built-in Functions-Binary Conversion.md --- Built-in Functions-Binary Conversion.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Built-in Functions-Binary Conversion.md b/Built-in Functions-Binary Conversion.md index bedea1b87..dc5ea20f9 100644 --- a/Built-in Functions-Binary Conversion.md +++ b/Built-in Functions-Binary Conversion.md @@ -9,9 +9,16 @@ To write a Python program to convert the number **16** into its **binary represe 3. Print the result. ## 🧾 Program +``` +x=16 +y=bin(x) +print(y) +``` + -Add Code Here ## Output +![image](https://github.com/user-attachments/assets/eb21d0cf-f113-4233-b719-2318653f5522) ## Result +Thus the python program is executed successfully From d16fc149bd7dbb6983dff6eed56113635d67eb22 Mon Sep 17 00:00:00 2001 From: 24900452 Date: Tue, 29 Apr 2025 11:29:50 +0530 Subject: [PATCH 2/6] Update Functions: Modulo Calculator.md --- Functions: Modulo Calculator.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Functions: Modulo Calculator.md b/Functions: Modulo Calculator.md index d32881f06..0ffcb0072 100644 --- a/Functions: Modulo Calculator.md +++ b/Functions: Modulo Calculator.md @@ -11,9 +11,22 @@ 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): + modulo_value = a % b + return modulo_value + +a=int(input()) +b=int(input()) +print("modulo is", result(a, b)) +``` + + -Add code Here ## Output +![image](https://github.com/user-attachments/assets/16d5e049-3c09-42cb-83be-c261ebd7dc66) + ## Result +Thus the python code is executed successfully From 296258f76ee83dc98514859558c94fa35392a80c Mon Sep 17 00:00:00 2001 From: 24900452 Date: Tue, 29 Apr 2025 11:31:26 +0530 Subject: [PATCH 3/6] 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..96619d0ae 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 +``` +i=int(input()) +j=int(input()) +z=int(input()) + +f = lambda a, b,c: a+b+c + +print(f(i, j,z)) +``` ## Output +![image](https://github.com/user-attachments/assets/c67311de-5870-42b4-94bb-1b4c2fb0c356) + ## Result + +Thus,the Python program that defines a lambda function which takes two arguments a and b, and returns their sum is created successfully. From ad7f7f1e2a52a504adc10b6bff695e3d0d90a5f7 Mon Sep 17 00:00:00 2001 From: 24900452 Date: Tue, 29 Apr 2025 11:32:44 +0530 Subject: [PATCH 4/6] Update Looping(Patterns)-Pascal's Triangle Generator.md --- ...g(Patterns)-Pascal's Triangle Generator.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Looping(Patterns)-Pascal's Triangle Generator.md b/Looping(Patterns)-Pascal's Triangle Generator.md index 1a7dec6c3..7d4658da6 100644 --- a/Looping(Patterns)-Pascal's Triangle Generator.md +++ b/Looping(Patterns)-Pascal's Triangle Generator.md @@ -27,9 +27,26 @@ To write a Python program that generates **Pascal's Triangle** using numbers. Th --- ## 🧪 Program -Add Code Here +``` +rows = int(input()) +coef = 1 + +for i in range(1, rows+1): + for space in range(1, rows-i+1): + print(" ",end="") + for j in range(0, i): + if j==0 or i==0: + coef = 1 + else: + coef = coef * (i - j)//j + print(coef, end = " ") + print() +``` ## Sample Output +![image](https://github.com/user-attachments/assets/ab54bf71-edb9-4b6a-ab47-ab7b2729b979) + ## Result +Thus,the Python program that generates Pascal's Triangle using numbers. The number of rows is accepted from the user is created successfully. From eb03b0d212096e6d0bb7516589cda13116d6d0d8 Mon Sep 17 00:00:00 2001 From: 24900452 Date: Tue, 29 Apr 2025 11:34:45 +0530 Subject: [PATCH 5/6] Update Loops-Palindrome Number check.md --- Loops-Palindrome Number check.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Loops-Palindrome Number check.md b/Loops-Palindrome Number check.md index 15dd6d692..9f2178bbc 100644 --- a/Loops-Palindrome Number check.md +++ b/Loops-Palindrome Number check.md @@ -16,7 +16,23 @@ 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()) +rev=0 +temp=num +while temp>0: + rev=(10*rev)+temp%10 + temp//=10 +if rev==num: + print("The given number {} is a Palindrome".format(num)) +else: + print("The given number {} is not a palindrome".format(num)) +``` + ## Output +![image](https://github.com/user-attachments/assets/d3b890b8-34d1-48a7-ab16-25c77ee68436) + ## Result +Thus,the Python program that checks whether a given number is a palindrome using loops is created successfully. + From c214cd915d8ddf60836c7e0d1f57f8f8223bf5a0 Mon Sep 17 00:00:00 2001 From: AshwinKumar-Saveetha <155129814+AshwinKumar-Saveetha@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:00:37 +0530 Subject: [PATCH 6/6] Update Looping(Patterns)-Pascal's Triangle Generator.md --- Looping(Patterns)-Pascal's Triangle Generator.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Looping(Patterns)-Pascal's Triangle Generator.md b/Looping(Patterns)-Pascal's Triangle Generator.md index 7d4658da6..427032896 100644 --- a/Looping(Patterns)-Pascal's Triangle Generator.md +++ b/Looping(Patterns)-Pascal's Triangle Generator.md @@ -9,7 +9,6 @@ This project demonstrates a simple Python program to generate **Pascal’s Trian To write a Python program that generates **Pascal's Triangle** using numbers. The number of rows is accepted from the user. --- - ## 🧠 Algorithm 1. Start the program. @@ -49,4 +48,3 @@ for i in range(1, rows+1): ## Result Thus,the Python program that generates Pascal's Triangle using numbers. The number of rows is accepted from the user is created successfully. -