import random

maxv=[13,26,39,52]

num=random.sample(range(1,53),2) # tirage sans remise, retourne une liste de 2 nombres entre 1 et 52
num.sort() # on les trie dans l'ordre croissant (strict car tirage sans remise)

A,B=num

i=0 # find i such that A in E_i
if  A <= maxv[0]: # A in E1:
  i=1
elif A <= maxv[1]: # A in E2:
  i=2
elif A <= maxv[2]: # A in E3:
  i=3
else: # A in E4 :  pourquoi?
  i=4

print("A=%d in E_%d={%d, ...,%d}"%(A,i,maxv[i-1]-12,maxv[i-1]))

if B <= maxv[i-1]: # B in E_i :  pourquoi?
  print("B=%d is in E_%d"%(B,i))
  print("A and B are in the same subset")
else:
  print("B=%d is not in E_%d"%(B,i))
  print("A and B are not in the same subset")
