Count the Number of Digits in an Integer in Python
num = 12345
print(len(str(num)))
Output: 5
Explaination:- https://youtube.com/shorts/5LN_JZNlYqo
num = 12345
print(len(str(num)))
Output: 5
Explaination:- https://youtube.com/shorts/5LN_JZNlYqo
YouTube
Count the Number of Digits in an Integer in Python in 30 Seconds!
Count the number of digits in an integer in Python with this super simple trick you can master in just 30 seconds! In this YouTube Shorts tutorial, I’ll show...
Find Maximum Digit in a Number Using Built in Function
num = 59284
print(int(max(str(num))))
Output: 9
Explaination:- https://youtube.com/shorts/cz4UDAzmhFw
num = 59284
print(int(max(str(num))))
Output: 9
Explaination:- https://youtube.com/shorts/cz4UDAzmhFw
YouTube
Python One-Liner Tutorial | Find Maximum Digit in a Number Using Built in Function
If you’ve ever wondered how to find the maximum digit in a number using built in function in Python, this video is for you! 🚀 In this quick and simple tutor...
Find Maximum Digit in a Number Without Built in Function
num = 59284
max_digit = 0
while num > 0:
digit = num % 10
if digit > max_digit:
max_digit = digit
num = num // 10
print(max_digit)
Output: 9
Explaination:- https://youtube.com/shorts/xjZfaV7Xdjk
num = 59284
max_digit = 0
while num > 0:
digit = num % 10
if digit > max_digit:
max_digit = digit
num = num // 10
print(max_digit)
Output: 9
Explaination:- https://youtube.com/shorts/xjZfaV7Xdjk
YouTube
Find Maximum Digit in a Number Without Built in Functions
If you want to find the maximum digit in a number without built in functions in Python, this quick tutorial is perfect for you! In this video, we break down ...
Find the Factors of a Number in Python
num = 12
for i in range(1, num+1):
if num % i == 0:
print(i)
Output:
1
2
3
4
6
12
Explaination:- https://youtube.com/shorts/qvt2EB5_4b4
num = 12
for i in range(1, num+1):
if num % i == 0:
print(i)
Output:
1
2
3
4
6
12
Explaination:- https://youtube.com/shorts/qvt2EB5_4b4
YouTube
Find the Factors of a Number in Python
If you want to find the factors of a number in Python, this beginner-friendly tutorial will show you how in the simplest way possible! We’ll go step by step ...
Find GCD of Two Numbers in Python
import math
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
result = math.gcd(a, b)
print("GCD of", a, "and", b, "is:", result)
Output
Input → 12, 18
GCD of 12 and 18 is: 6
Explaination:- https://youtube.com/shorts/QGd32oNoz6k
import math
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
result = math.gcd(a, b)
print("GCD of", a, "and", b, "is:", result)
Output
Input → 12, 18
GCD of 12 and 18 is: 6
Explaination:- https://youtube.com/shorts/QGd32oNoz6k
YouTube
Find GCD of Two Numbers in Python
Find GCD of two numbers in Python easily with this quick and clear tutorial! In this YouTube Shorts video, we show you a simple and efficient method to calcu...
Find LCM of Two Numbers in Python
import math
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
gcd = math.gcd(a, b)
lcm = (a * b) // gcd
print("LCM of", a, "and", b, "is:", lcm)
Output
Input → 12, 18
LCM of 12 and 18 is: 36
Explaination:- https://youtube.com/shorts/N17ktpEOMoI
import math
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
gcd = math.gcd(a, b)
lcm = (a * b) // gcd
print("LCM of", a, "and", b, "is:", lcm)
Output
Input → 12, 18
LCM of 12 and 18 is: 36
Explaination:- https://youtube.com/shorts/N17ktpEOMoI
YouTube
Find LCM of Two Numbers in Python
Find LCM of Two Numbers in PythonFind LCM of two numbers in Python easily with this quick and clear tutorial! In this YouTube Shorts video, you’ll learn a si...
Check Whether a Number is Palindrome or Not
num = 121
temp = num
rev = 0
while num > 0:
digit = num % 10
rev = rev * 10 + digit
num = num // 10
if temp == rev:
print("Palindrome")
else:
print("Not Palindrome")
Output
Input → 121 → Palindrome
Input → 123 → Not Palindrome
Explaination:- https://youtube.com/shorts/Aql1suBSlys
num = 121
temp = num
rev = 0
while num > 0:
digit = num % 10
rev = rev * 10 + digit
num = num // 10
if temp == rev:
print("Palindrome")
else:
print("Not Palindrome")
Output
Input → 121 → Palindrome
Input → 123 → Not Palindrome
Explaination:- https://youtube.com/shorts/Aql1suBSlys
YouTube
Check Whether a Number is Palindrome or Not
Check Whether a Number is Palindrome or Not Check whether a number is palindrome or not using Python with this short and easy tutorial! In this YouTube Short...
Find Square & Cube of Number | Python
num = 5
square = num ** 2
cube = num ** 3
print("Square:", square)
print("Cube:", cube)
Output
Input → 5
Square: 25
Cube: 125
Explaination:- https://youtube.com/shorts/bXydwbsH5eY
num = 5
square = num ** 2
cube = num ** 3
print("Square:", square)
print("Cube:", cube)
Output
Input → 5
Square: 25
Cube: 125
Explaination:- https://youtube.com/shorts/bXydwbsH5eY
YouTube
Find Square & Cube of Number | Python
Python Program to Find Square & Cube of Number is a quick and easy tutorial that helps beginners understand how to calculate both the square and cube of any ...
Calculate the Average of N Numbers
n = int(input("How many numbers? "))
numbers = []
for i in range(n):
num = float(input("Enter number: "))
numbers.append(num)
total = sum(numbers)
average = total / n
print("Average =", average)
Output
Input → 5 numbers: 10, 20, 30, 40, 50
Average = 30.0
Explaination:- https://youtube.com/shorts/g3ddbmTOyBk
n = int(input("How many numbers? "))
numbers = []
for i in range(n):
num = float(input("Enter number: "))
numbers.append(num)
total = sum(numbers)
average = total / n
print("Average =", average)
Output
Input → 5 numbers: 10, 20, 30, 40, 50
Average = 30.0
Explaination:- https://youtube.com/shorts/g3ddbmTOyBk
YouTube
Calculate the Average of N Numbers | Python in 60 Seconds!
Calculate the Average of N Numbers | Python in 60 Seconds! — In this quick Python Short, you’ll learn how to calculate the average (mean) of any number of va...
Convert a Decimal Number to Binary
num = int(input("Enter a number: "))
binary = bin(num)
print("Binary with prefix:", binary)
print("Binary without prefix:", binary[2:])
Output
Input → 10
Binary with prefix: 0b1010
Binary without prefix: 1010
Explaination:- https://youtube.com/shorts/ExCnEOeiRoM
num = int(input("Enter a number: "))
binary = bin(num)
print("Binary with prefix:", binary)
print("Binary without prefix:", binary[2:])
Output
Input → 10
Binary with prefix: 0b1010
Binary without prefix: 1010
Explaination:- https://youtube.com/shorts/ExCnEOeiRoM
YouTube
Convert a Decimal Number to Binary | Python in 60 Seconds!
Convert a Decimal Number to Binary | Python in 60 Seconds! — In this lightning-fast YouTube Short you'll learn a clean, practical way to convert any decimal ...
Day 1 - Find Sum of N Odd Numbers
def sum_odd_numbers(n):
return n * n
print(sum_odd_numbers(5)) # 25
Output
Input → 5
Output → 25
Explaination:- https://youtube.com/shorts/jTcG6qdsezg
def sum_odd_numbers(n):
return n * n
print(sum_odd_numbers(5)) # 25
Output
Input → 5
Output → 25
Explaination:- https://youtube.com/shorts/jTcG6qdsezg
YouTube
Day 1 - Find Sum of N Odd Numbers in Just 1 Minute!
Day 1 - Find Sum of N Odd Numbers is the perfect quick-start coding challenge for beginners! In this YouTube Short, you’ll learn how to calculate the sum of ...
Day 2 - Find Sum of N Even Numbers
def sum_even_numbers(n):
return n * (n + 1)
print(sum_even_numbers(5)) # 30
Output
Input → 5
Output → 30
Explaination:- https://youtube.com/shorts/GzKIyDgCZFk
def sum_even_numbers(n):
return n * (n + 1)
print(sum_even_numbers(5)) # 30
Output
Input → 5
Output → 30
Explaination:- https://youtube.com/shorts/GzKIyDgCZFk
YouTube
Day 2 - Find Sum of N Even Numbers in Just 1 Minute!
Day 2 - Find Sum of N Even Numbers is your next quick and fun coding challenge! 💻 In this YouTube Short, you’ll learn how to calculate the sum of the first ...
Day 3 - Convert Binary to Decimal in Just 1 Minute!
def binary_to_decimal(binary_str):
decimal = 0
power = len(binary_str) - 1
for digit in binary_str:
decimal += int(digit) * (2 ** power)
power -= 1
return decimal
print(binary_to_decimal("1010")) # 10
print(binary_to_decimal("1111")) # 15
Output
Input → "1010" → Output → 10
Input → "1111" → Output → 15
Explaination:- https://youtube.com/shorts/b6t5G9AV71w
def binary_to_decimal(binary_str):
decimal = 0
power = len(binary_str) - 1
for digit in binary_str:
decimal += int(digit) * (2 ** power)
power -= 1
return decimal
print(binary_to_decimal("1010")) # 10
print(binary_to_decimal("1111")) # 15
Output
Input → "1010" → Output → 10
Input → "1111" → Output → 15
Explaination:- https://youtube.com/shorts/b6t5G9AV71w
YouTube
Day 3 - Convert Binary to Decimal in Just 1 Minute!
Day 3 - Convert Binary to Decimal is a quick and easy coding tutorial designed to help beginners understand number system conversion in under a minute! 💻 In...
Day 4 - Convert Octal to Decimal in Just 1 Minute!
def octal_to_decimal(octal_str):
decimal = 0
power = len(octal_str) - 1
for digit in octal_str:
decimal += int(digit) * (8 ** power)
power -= 1
return decimal
print(octal_to_decimal("12")) # 10
print(octal_to_decimal("77")) # 63
Output
Input → "12" → Output → 10
Input → "77" → Output → 63
Explaination:- https://youtube.com/shorts/2uqOZSl40Ms
def octal_to_decimal(octal_str):
decimal = 0
power = len(octal_str) - 1
for digit in octal_str:
decimal += int(digit) * (8 ** power)
power -= 1
return decimal
print(octal_to_decimal("12")) # 10
print(octal_to_decimal("77")) # 63
Output
Input → "12" → Output → 10
Input → "77" → Output → 63
Explaination:- https://youtube.com/shorts/2uqOZSl40Ms
YouTube
Day 4 - Convert Octal to Decimal in Just 1 Minute!
Day 4 - Convert Octal to Decimal is a quick and easy Python coding tutorial that teaches you how to convert octal numbers (base 8) into decimal numbers (base...
Day 5 - Sum of All Elements in a Matrix
def matrix_sum(matrix):
total = 0
for row in matrix:
for element in row:
total += element
return total
# Example
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(matrix_sum(matrix)) # 45
Output
Input → [[1,2,3],[4,5,6],[7,8,9]]
Output → 45
Explaination:- https://youtube.com/shorts/sediRwo9SgE
def matrix_sum(matrix):
total = 0
for row in matrix:
for element in row:
total += element
return total
# Example
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(matrix_sum(matrix)) # 45
Output
Input → [[1,2,3],[4,5,6],[7,8,9]]
Output → 45
Explaination:- https://youtube.com/shorts/sediRwo9SgE
YouTube
Day 5 - Sum of All Elements in a Matrix
Day 5 - Sum of All Elements in a Matrix is a simple yet powerful Python challenge to boost your coding logic and matrix-handling skills. In this quick YouTub...
Day 6 - Count Vowels and Consonants in a String
def count_vowels_consonants(text):
vowels = "aeiou"
v_count = 0
c_count = 0
for char in text.lower():
if char in vowels:
v_count += 1
elif char.isalpha():
c_count += 1
return v_count, c_count
text = input("Enter a text: ")
v, c = count_vowels_consonants(text)
print("Vowels:", v)
print("Consonants:", c)
Output
Input → Hello World
Vowels: 3
Consonants: 7
Explaination:- https://youtube.com/shorts/HhYb_mDR5Js
def count_vowels_consonants(text):
vowels = "aeiou"
v_count = 0
c_count = 0
for char in text.lower():
if char in vowels:
v_count += 1
elif char.isalpha():
c_count += 1
return v_count, c_count
text = input("Enter a text: ")
v, c = count_vowels_consonants(text)
print("Vowels:", v)
print("Consonants:", c)
Output
Input → Hello World
Vowels: 3
Consonants: 7
Explaination:- https://youtube.com/shorts/HhYb_mDR5Js
YouTube
Day 6 - Count Vowels and Consonants in a String
Day 6 - Count Vowels and Consonants in a String is a fun and simple Python challenge that helps beginners strengthen their string manipulation skills. In thi...
Day 7 - Remove Vowels from a String
def remove_vowels(text):
vowels = "aeiouAEIOU"
result = ""
for char in text:
if char not in vowels:
result += char
return result
print(remove_vowels("Hello World"))
Output
Input → Hello World
Output → Hll Wrld
Explaination:- https://youtube.com/shorts/dyVn8hwiFLQ
def remove_vowels(text):
vowels = "aeiouAEIOU"
result = ""
for char in text:
if char not in vowels:
result += char
return result
print(remove_vowels("Hello World"))
Output
Input → Hello World
Output → Hll Wrld
Explaination:- https://youtube.com/shorts/dyVn8hwiFLQ
YouTube
Day 7 - Remove Vowels from a String | Easy Python Trick
Day 7 - Remove Vowels from a String is a fun and easy Python coding challenge designed to improve your string manipulation skills. In this YouTube Short, you...
Day 8 - Check Whether a Number is Armstrong or not
def is_armstrong(num):
digits = [int(d) for d in str(num)]
power = len(digits)
return sum(d ** power for d in digits) == num
print(is_armstrong(153)) # True
print(is_armstrong(123)) # False
Output
Input → 153
True
Input → 123
False
Explaination:- https://youtube.com/shorts/KpLZNPkGc2M
def is_armstrong(num):
digits = [int(d) for d in str(num)]
power = len(digits)
return sum(d ** power for d in digits) == num
print(is_armstrong(153)) # True
print(is_armstrong(123)) # False
Output
Input → 153
True
Input → 123
False
Explaination:- https://youtube.com/shorts/KpLZNPkGc2M
YouTube
Day 8 - Check Whether a Number is Armstrong or Not
Day 8 - Check Whether a Number is Armstrong or Not is a fun and quick coding challenge designed to boost your Python logic and mathematical problem-solving s...
Day 9 - Calculate Power of a Number
def power(x, y):
result = 1
for _ in range(y):
result *= x
return result
print(power(2, 3)) # 8
print(power(5, 2)) # 25
Output
Input → 2 3
Output → 8
Input → 5 2
Output → 25
Explaination:- https://youtube.com/shorts/0IENdrRgI-M
def power(x, y):
result = 1
for _ in range(y):
result *= x
return result
print(power(2, 3)) # 8
print(power(5, 2)) # 25
Output
Input → 2 3
Output → 8
Input → 5 2
Output → 25
Explaination:- https://youtube.com/shorts/0IENdrRgI-M
YouTube
Day 9 - Calculate Power of a Number
Day 9 - Calculate Power of a Number is your next exciting coding challenge in this Python Shorts series! 💻 In this video, you’ll learn how to calculate the ...
Day 10 - Check Whether a Number is Perfect or Not
def is_perfect_number(num):
if num <= 1:
return False
divisors_sum = 0
for i in range(1, num):
if num % i == 0:
divisors_sum += i
return divisors_sum == num
print(is_perfect_number(6)) # True
print(is_perfect_number(28)) # True
print(is_perfect_number(12)) # False
Output
Input → 6
Output → True
Input → 28
Output → True
Input → 12
Output → False
Explaination:- https://youtube.com/shorts/WTQr72jBICM
def is_perfect_number(num):
if num <= 1:
return False
divisors_sum = 0
for i in range(1, num):
if num % i == 0:
divisors_sum += i
return divisors_sum == num
print(is_perfect_number(6)) # True
print(is_perfect_number(28)) # True
print(is_perfect_number(12)) # False
Output
Input → 6
Output → True
Input → 28
Output → True
Input → 12
Output → False
Explaination:- https://youtube.com/shorts/WTQr72jBICM
YouTube
Day 10 - Check Whether a Number is Perfect or Not
Day 10 - Check Whether a Number is Perfect or Not is a fun and simple Python coding challenge designed to boost your logic and programming confidence! 💻 In ...