def run(self): number = int(input("enter number")) binary = utility.Utility().converttobinary(number) print("binary", binary) afterswapped = utility.Utility().swapnibble(binary) print("after swapping", afterswapped) decimal = utility.Utility().binarytodecimal(afterswapped) print(decimal) return
def run(self): for i in range(10, 1000): if (utility.Utility().checkPrime(i) == True): if (utility.Utility().checkpalindrome(str(i)) == True): print(i) return
def run(self): for i in range(2, 1000): if (utility.Utility().checkPrime(i) == True): for j in range(i + 1, 1000): if (utility.Utility().checkPrime(j) == True): if( utility.Utility().checkanagram(str(i),str(j))==True): print(i, j) return
def run(self): word1 = input("enter first word") word2 = input("enter second word") if (utility.Utility().checkanagram(word1, word2) == True): print("they are anagram") else: print("they are not")
def run(self): list1 = [443, 54, 23, 65, 34] length = len(list1) utility.Utility().mergeSort(list1, 0, length - 1) print(list1) return
def run(self): change = int(input("enter change")) list1 = ['1000', '500', '100', '50', '10', '5', '2', '1'] length = len(list1) dlist = {} for i in range(0, len(list1)): dlist[list1[i]] = 0 list2 = [0] * length utility.Utility().vendingmachine(change, 0, list1, list2, dlist) return
def run(self): day = int(input("enter day")) month = int(input("enter month")) year = int(input("enter year")) daylist = [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ] index = utility.Utility().dayofweek(day, month, year) print("the day is ", daylist[index]) return
def run(self): for i in range(2, 1000): if (utility.Utility().checkPrime(i) == True): print(i) return
def run(self): number = int(input("enter number")) binary = utility.Utility().converttobinary(number) print(binary) return
def run(self): cel = int(input("enter temp in celsius")) fahr = int(input("enter temp in fahr")) utility.Utility().tempconversion(fahr, cel) return
def run(self): number = int(input("enter number")) utility.Utility().binarySearchFind(0, number) return
def run(self): word = input("enter word") print(utility.Utility().findword(word)) return
def run(self): number = int(input("enter the number")) utility.Utility().newtonsqrt(number) return