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
8 changes: 7 additions & 1 deletion Built-in Functions-Binary Conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ To write a Python program to convert the number **16** into its **binary represe

## 🧾 Program

Add Code Here
```
a=16
print(bin(a))
```

## Output
<img width="698" height="324" alt="image" src="https://github.com/user-attachments/assets/e4cf7383-ad75-4a76-bb4f-b19d88cc9539" />


## Result
Thus, the program has been successfully executed.
15 changes: 14 additions & 1 deletion Functions: Modulo Calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@ To write a Python program that defines a function which accepts two values and r

## 🧾 Program

Add code Here
```
def result(a, b):
modulo_value = a % b
return modulo_value
a=int(input())
b=int(input())
print("modulo is", result(a, b))
```


## Output

<img width="823" height="389" alt="image" src="https://github.com/user-attachments/assets/3dc3c582-5526-4cb4-beec-7daac118678c" />


## Result

The program to return two values modulo is successful.
13 changes: 12 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,19 @@ 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())
b=int(input())
f=lambda a,b: a+b
print(f(a,b))

```

## Output

<img width="580" height="234" alt="image" src="https://github.com/user-attachments/assets/166e214f-a2aa-43ca-8169-03d3de1a8c58" />


## Result

Thus, the program has been successfully executed.
21 changes: 20 additions & 1 deletion Looping(Patterns)-Pascal's Triangle Generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,28 @@ To write a Python program that generates **Pascal's Triangle** using numbers. Th
---

## 🧪 Program
Add Code Here

```
def factorial(n):
if n == 0 or n == 1:
return 1
return n * factorial(n - 1)
def combination(n, k):
return factorial(n) // (factorial(k) * factorial(n - k))
num_rows = int(input("Enter number of rows: "))
for i in range(num_rows):
print(' ' * (num_rows - i - 1), end='')
for j in range(i + 1):
print(combination(i, j), end=' ')
print()
```

## Sample Output

<img width="258" height="282" alt="image" src="https://github.com/user-attachments/assets/f1b67d5e-322f-4f99-847b-440bbc153b52" />


## Result

Thus, the program has been successfully executed

26 changes: 25 additions & 1 deletion Loops-Palindrome Number check.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,31 @@ 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

<img width="737" height="140" alt="image" src="https://github.com/user-attachments/assets/18cf504a-d8aa-488d-bcb7-2778956a47ac" />

## Result

Thus, the program has been successfully executed .