• Feb 23, 2025 •hasnaoui1
0 likes • 7 views
print("hello world")
• Jun 16, 2024 •lagiath
0 likes • 1 view
print('hello, world')
• Nov 19, 2022 •CodeCatch
0 likes • 6 views
# function which return reverse of a string def isPalindrome(s): return s == s[::-1] # Driver code s = "malayalam" ans = isPalindrome(s) if ans: print("Yes") else: print("No")
• Nov 18, 2022 •AustinLeath
0 likes • 3 views
primes=[] products=[] def prime(num): if num > 1: for i in range(2,num): if (num % i) == 0: return False else: primes.append(num) return True for n in range(30,1000): if len(primes) >= 20: break; else: prime(n) for previous, current in zip(primes[::2], primes[1::2]): products.append(previous * current) print (products)
• Mar 26, 2023 •AustinLeath
0 likes • 0 views
import os # Get the current directory current_dir = os.getcwd() # Loop through each file in the current directory for filename in os.listdir(current_dir): # Check if the file name starts with a number followed by a period and a space if filename[0].isdigit() and filename[1] == '.' and filename[2] == ' ': # Remove the number, period, and space from the file name new_filename = filename[3:] # Rename the file os.rename(os.path.join(current_dir, filename), os.path.join(current_dir, new_filename))
• Sep 6, 2020 •C S
0 likes • 2 views
def Fibonacci(n): if n<0: print("Incorrect input") # First Fibonacci number is 0 elif n==1: return 0 # Second Fibonacci number is 1 elif n==2: return 1 else: return Fibonacci(n-1)+Fibonacci(n-2) # Driver Program print(Fibonacci(9))