Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを書きました。else ステートメントが true の場合、プログラムをシャットダウンしたいと思います。私はpythonが初めてで、いくつかの問題を抱えています
password = raw_input('Enter yes to continue:') if password == 'yes': print'You have chosen to continue' else: print'You have chosen to exit'
これをコードに追加します
import sys # This goes at the header ... if password == 'yes' pass # Your code goes on... I put the 'pass' just as a place holder else sys.exit()