Two teams and x ,, a war not, b, and not y, z, please write code to achieve

 

To achieve the following:

# Here are two teams and x ,, a war not, b, and not y, z, please write code. 
TEAM1 = [ ' A ' , ' B ' , ' C ' ] 
Team2 = [ ' X ' , ' Y ' , ' Z ' ]
 for team1_value in TEAM1:   # clan 1 cycle 
    for team2_value in Team2: # team 2 cycles 
        IF team1_value == ' A '  and team2_value == ' X ': # Clan 1 equal to a, is equal to 2 team x, the output is not performed, continues 
            Continue 
        IF team1_value == ' B '  and (team2_value == ' Y '  or team2_value == ' Z ' ): # team B is equal to 1, 2 clan y is equal to or Z, no output, continued 
            continue 
        the else : # than above two cases, output 
            Print ( " % S% S VS " % (team1_value, team2_value))
C:\Users\zhaow\AppData\Local\Programs\Python\Python37\python.exe D:/study/python/test/yc.py
a vs  y
a vs  z
b vs  x
c vs  x
c vs  y
c vs  z

 

Guess you like

Origin www.cnblogs.com/xiaokuangnvhai/p/11205011.html