Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Built-in Functions-Binary Conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 14 additions & 1 deletion Functions: Modulo Calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 13 additions & 1 deletion Lambda Function: Addition of Two Numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
21 changes: 18 additions & 3 deletions Looping(Patterns)-Pascal's Triangle Generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,9 +26,25 @@ 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

## Result
Thus,the Python program that generates Pascal's Triangle using numbers. The number of rows is accepted from the user is created successfully.
18 changes: 17 additions & 1 deletion Loops-Palindrome Number check.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.