If-then (Python, comparison)
Versie door Jeroen Strompf (overleg | bijdragen) op 14 jan 2019 om 12:57
#! /usr/bin/python3 # # ifthen.py - Jan. 2019 ############################################################################## # # Simpel voorbeeld ############################################################################## # s="abc" if s=="def": print("String is 'def'") elif s=="efg": print("String is 'efg'") else: print("String is niet 'def' en ook niet 'efg'") # Zonder elif of else - Je hebt dus echt geen afsluitend statement nodig ############################################################################## # s="abc" if s=="def": print("String is 'def'")