M.Sc Python Programming Assignment 8
M.Sc Python Programming Assignments Assignment 8 Question: To check whether a number is palindrome or not. (using recursion and without recursion). Code: def is_palindrome_recursive(word): if len(word)
M.Sc Python Programming Assignments Assignment 8 Question: To check whether a number is palindrome or not. (using recursion and without recursion). Code: def is_palindrome_recursive(word): if len(word)
M.Sc Python Programming Assignments Assignment 7 Question: To determine whether the number is prime or not Code: def is_prime(number): if number < 2: return False for i in range(2, int(number ** 0.5) + 1): if number % i == 0: return False return True number = int(input("Enter a number: ")) if is_prime(number): print(f"{number} is …