0
if len(sys.argv) == 2 and sys.argv[1] == "english":
    PHRASE_FIRST == True

Actually I do know the function of these codes, but when I type into only 1 argument when I try to run it, the result is no different from the one when I follow the code typing into 2 arguments and the second one is "english".From my understanding, it supposes to be different in subsequent code.

for snippet in snippets: 
    phrase = PHRASES[snippet] 
    question, answer = convert(snippet, phrase) 

    if PHRASE_FIRST:
        question, answer = answer, question

And also, I don't know what's this line for... to exchange values? But I didn't see any changes when the PHRASE_FIRST is True or False.

Millie HU
  • 23
  • 1

1 Answers1

0

You mixed up = and ==.

In your second line, use PHRASE_FIRST = True (only one =). What you have right now is a test whether PHRASE_FIRST is True (==). But you want to change the value of PHRASE_FIRST. Therefore only use one =.

As for your second question (swap values) you're correct. See here

akraf
  • 2,965
  • 20
  • 44