fork download
  1. print("\nPerulangan do while:")
  2. k = 10
  3. while True:
  4. print("k =", k)
  5. k -= 3
  6. if k < 1: # berhenti kalau sudah kurang dari 1
  7. break
Success #stdin #stdout 0.02s 7056KB
stdin
Standard input is empty
stdout
Perulangan do while:
('k =', 10)
('k =', 7)
('k =', 4)
('k =', 1)