repl.it
@LogikLogicus/

ShatteredIdentity

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import time
# Define a function to evaluate the identity law
def identity(x, y):
  print("{} = {} is {}".format(x, y, x == y))

# Evaluate the permutations
def evaluate_permutations(S):
  # Compare 1st element to itself
  identity( S[0], S[0] )
  # Compare 1st element to 2nd element
  identity( S[0], S[1] )
  # Compare 2nd element to 1st element
  identity( S[1], S[0] )
  # Compare 2nd element to itself
  identity( S[1], S[1] )


# Pair of As
A = [ 'A', 'A' ]
evaluate_permutations(A)

print("Sanity prevails!")

print()

# Pair of As
A = [ 'A', 'А' ]
evaluate_permutations(A)

print("Insanity returns!")