import random n1 = random.randint( 1, 40 ) n2 = random.randint( 1, 40 ) n3 = random.randint( 1, 40 ) n4 = random.randint( 1, 40 ) n5 = random.randint( 1, 40 ) n6 = random.randint( 1, 40 ) while ( n1 == n2 ) or ( n1 == n3 ) or ( n1 == n4 ) or ( n1 == n5 ) or ( n1 == n6 ) or ( n2 == n3 ) or ( n2 == n4 ) or ( n2 == n5 ) or ( n2 == n6 ) or ( n3 == n4 ) or ( n3 == n5 ) or ( n3 == n6 ) or ( n4 == n5 ) or ( n4 == n6 ) or ( n5 == n6 ) : n1 = random.randint( 1, 40 ) n2 = random.randint( 1, 40 ) n3 = random.randint( 1, 40 ) n4 = random.randint( 1, 40 ) n5 = random.randint( 1, 40 ) n6 = random.randint( 1, 40 ) else : print( "Lottery Numbers:", n1, n2, n3, n4, n5, n6 )