n = int(input("Enter a number: "))
sum_of_numbers = n * (n + 1) // 2
print(f"The sum of the first {n} natural numbers is: {sum_of_numbers}")
#source code --> clcoding.com
Python Developer December 02, 2024 100 Python Programs for Beginner No comments
Python Developer December 02, 2024 100 Python Programs for Beginner No comments
def conversion(cm):
total_inches = cm / 2.54
feet = int(total_inches // 12)
inches = total_inches % 12
return feet, inches
cm = float(input("Enter length in centimeters: "))
feet, inches = conversion(cm)
print(f"{cm} cm is approximately {feet} feet and {inches:.2f} inches.")
#source code --> clcoding.com
Python Developer November 30, 2024 100 Python Programs for Beginner No comments
def is_prime(number, divisor=2):
if number <= 1:
return False
if divisor == number:
return True
if number % divisor == 0:
return False
return is_prime(number, divisor + 1)
num = int(input("Enter a number: "))
if is_prime(num):
print(f"{num} is a prime number.")
else:
print(f"{num} is not a prime number.")
#source code --> clcoding.com
Python Developer November 30, 2024 100 Python Programs for Beginner No comments
start = int(input("Enter the start of the range: "))
end = int(input("Enter the end of the range: "))
for num in range(start, end + 1):
if num > 1 and all(num % i != 0 for i in range(2, num)):
print(num)
#source code --> clcoding.com
Python Developer November 28, 2024 100 Python Programs for Beginner, Python No comments
Python Developer November 28, 2024 100 Python Programs for Beginner, Python No comments
Python Developer November 27, 2024 100 Python Programs for Beginner, Python No comments
Python Coding November 27, 2024 100 Python Programs for Beginner No comments
def is_even(number):
if number == 0:
return True
elif number == 1:
return False
else:
return is_even(number - 2)
num = int(input("Enter a number: "))
if is_even(num):
print(f"The number {num} is Even.")
else:
print(f"The number {num} is Odd.")
#source code --> clcoding.com
Python Coding November 27, 2024 100 Python Programs for Beginner, Python No comments
def grade_student(marks):
if marks >= 90:
return "A"
elif marks >= 80:
return "B"
elif marks >= 70:
return "C"
elif marks >= 60:
return "D"
elif marks >= 50:
return "E"
else:
return "F"
marks = float(input("Enter the marks of the student: "))
grade = grade_student(marks)
print(f"The grade of the student is: {grade}")
#source code --> clcoding.com
Free Books Python Programming for Beginnershttps://t.co/uzyTwE2B9O
— Python Coding (@clcoding) September 11, 2023
Top 10 Python Data Science book
— Python Coding (@clcoding) July 9, 2023
🧵:
Top 4 free Mathematics course for Data Science ! pic.twitter.com/s5qYPLm2lY
— Python Coding (@clcoding) April 26, 2024
Web Development using Python
— Python Coding (@clcoding) December 2, 2023
🧵: