title: run a task if something Worked Python3
body: <p>This is my script. What I want to do is that I want to run the print function if the call function worked.</p>
  
  <pre><code>from subprocess import call
  from os import system as S
  
  Com1 = 'sudo xrandr --newmode "1368x768_60.00"   85.25  1368 1440 1576 
  1784  768 771 781 798 -hsync +vsync'
  Command1 = Com1.split()
  Com2 = 'sudo xrandr --addmode VGA1 "1368x768_60.00"'
  Command2 = Com2.split() 
  COMMAND1 = call(Command1)
  COMMAND2 = call(Command2)
  print('\n\n\t\nscreen resolution successfully changed Script By : My name '.title())
  print('\n\n')
  </code></pre>
  
  <p>This is a pseudocode of this: </p>
  
  <pre><code>if COMMAND1 and COMMAND2 worked:
    print('It WorkEd')
  else:
    print('IT DIDNT WORK')    
  </code></pre>
  
  <p>Can someone please help me. I am very new in Python.</p>