title: How to write a proper if statement in Python?
body: <p>I made this simple Caesar Cipher program with Python that Encodes and Decodes words, all I want to do is to write an if statement for the user if they wrote a wrong word (anything other than &quot;decode&quot; and &quot;encode&quot;) and tell them to try again, I kept trying and did a lot of researches I couldn't find anything that helped.. There are of course a lot of other ways of doing that, but I want to add that into my particular code rather than changing the code itself, which I don't know how..</p>
  <p>Any help would be appreciated..</p>
  <p>Here's my code:</p>
  <pre><code>#from art import logo
  #print(logo)
  
  alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  
  def caesar(start_text, shift_amount, cipher_direction):
    end_text = &quot;&quot;
  
    if cipher_direction == &quot;decode&quot;:
      shift_amount *= -1
    for char in start_text:
      if char in alphabet:
          position = alphabet.index(char)
          new_position = position + shift_amount
          end_text += alphabet[new_position]
      else:
          end_text += char
    
      
    print(f&quot;\nHere's the {cipher_direction}d result: {end_text}&quot;)
  
  
  
  should_continue = True
  while should_continue:
      direction = input(&quot;\nType 'encode' to encrypt, type 'decode' to decrypt: &quot;)
      text = input(&quot;\nType your message: &quot;).lower()
      shift = int(input(&quot;\nType the shift number: &quot;))
  
      shift = shift % 26
      caesar(start_text=text, shift_amount=shift, cipher_direction=direction)
  
      result = input(&quot;\nType 'yes' if you want to go again, otherwise type 'no': &quot;).lower()
      if result == &quot;no&quot;:
          should_continue = False
          print(&quot;\nGoodbye!&quot;)
  </code></pre>