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
Ejemplo n.º 2
0
    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
Ejemplo n.º 4
0
 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")
Ejemplo n.º 5
0
    def run(self):
        list1 = [443, 54, 23, 65, 34]
        length = len(list1)
        utility.Utility().mergeSort(list1, 0, length - 1)
        print(list1)

        return
Ejemplo n.º 6
0
 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
Ejemplo n.º 7
0
 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
Ejemplo n.º 8
0
    def run(self):
        for i in range(2, 1000):
            if (utility.Utility().checkPrime(i) == True):
                print(i)

        return
Ejemplo n.º 9
0
 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
Ejemplo n.º 11
0
 def run(self):
     number = int(input("enter number"))
     utility.Utility().binarySearchFind(0, number)
     return
Ejemplo n.º 12
0
 def run(self):
     word = input("enter word")
     print(utility.Utility().findword(word))
     return
Ejemplo n.º 13
0
 def run(self):
     number = int(input("enter the number"))
     utility.Utility().newtonsqrt(number)
     return