Esempio n. 1
0
 def test1_ForGreater(self):
     strings = ValueComparsions('1.1', '1.3')
     self.assertEqual(strings.greater(), '1.3 is greater than 1.1')
Esempio n. 2
0
 def test2_ForGreater(self):
     strings = ValueComparsions('-1.1', '-1.3')
     self.assertNotEqual(strings.greater(), '-1.3 is greater than -1.1')
Esempio n. 3
0
 def test3_ForGreater(self):
     strings = ValueComparsions('1.1', '0')
     self.assertTrue(strings.greater(), '1.1 is greater than 0')
Esempio n. 4
0
from twostring import ValueComparsions

if __name__ == '__main__':
    try:
        str1 = input('Enter a string Number 1\n')
        str2 = input('Enter a string Number 2 \n')
        result = ValueComparsions(str1, str2)
        if str1 == str2:
            print(result.equal())
            print(
                '{0} and {1} are not greater or \nlesser to each other'.format(
                    str1, str2))
        else:
            print(result.greater())
            print(result.equal())
            print(result.lesser())

    except ValueError:
        print('\n')
        print('_' * 42)
        print('Characters, strings are not allowed\n'
              "Please Enter only numbers \n{0}".format('_' * 42))