Python Program
Python Program
print("Hello World")
………………………………………………………………………………………………………........
..........................
while(True):
if((greater % x == 0) and (greater % y ==
0)):
lcm = greater
break
greater += 1
return lcm
# change the values of num1 and num2 for a
different result
num1 = 54
num2 = 24
# uncomment the following lines to take input
from the user
#num1 = int(input("Enter first number: "))
#num2 = int(input("Enter second number: "))
print("The L.C.M. of", num1,"and", num2,"is",
lcm(num1, num2))
# Program to find the ASCII value of the given
character
# Change this value for a different result
c = 'p'
# Uncomment to take character from user
#c = input("Enter a character: ")
print("The ASCII value of '" + c + "'
is",ord(c))
# Python Program to find the factors of a number
# define a function
def print_factors(x):
# This function takes a number and prints the
factors
print("The factors of",x,"are:")
for i in range(1, x + 1):
if x % i == 0:
print(i)
# change this value for a different result.
num = 320
# uncomment the following line to take input
from the user
#num = int(input("Enter a number: "))
print_factors(num)