SHARE
TWEET

Untitled

a guest Apr 26th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Perulangan menggunakan for
  2.  
  3. #bentuk 1
  4. for i in (1,2,3,4,5,6,7):
  5.     print(i)
  6. print "Selesai"
  7.  
  8. #bentuk 2
  9. for a in "AHMAD HERMAWAN ERTYANTO":
  10.     print (a)
  11. print "Selesai"
  12.  
  13. #bentuk 3
  14. for a in range(1,10):
  15.     print (a)\
  16.  
  17. #bentuk 4
  18. for a in ("Ahmad", 1, "Hermawan", 3):
  19.           print (a)
  20. print "Selesai"
  21.  
  22.          
  23. #.....................
  24. #   1. Pilih Makanan
  25. #       a. Mi Sambal Matah
  26. #       b. Mi Aceh
  27. #       c. Kembali (Menu Utama)
  28. #   2. Paket Minuman
  29. #       a. Jus Kedondong
  30. #       b. Jus Mangga
  31. #       c. Jus Melon
  32. #       d. Kembali (Menu Utama)
  33. #   3. Selesai
  34. #.....................
  35.  
  36. while(True) :
  37.     print "Operator"
  38.     print "=" *10
  39.     print "1. Pilih Makanan"
  40.     print "2. Paket Minuman"
  41.     print "3. Selesai"
  42.     pil = input("Pilihan Anda (1,2,3)?")
  43.     if (pil=="1"):
  44.         print "Anda memilih Makanan"
  45.         while (True):
  46.             print "a. Mi Sambal Matah"
  47.             print "b. Mi Aceh"
  48.             print "c. Kembali (Menu Utama)"
  49.             if (pil_mkn=="a"):
  50.                 print "Anda memilih Mi Sambal Matah"
  51.                 input " "
  52.             elif(pil_mkn=="b"):
  53.                 print "Anda memilih Mi Aceh"
  54.                 input " "
  55.             elif(pil_mkn=="c"):
  56.                 break
  57.             else:
  58.                  print "Pilih a,b,c"
  59.                  input " "
  60.     elif (pil=="2"):
  61.         print "Anda memilih Minuman"
  62.         while (True):
  63.             print "a. Jus Kedondong"
  64.             print "b. Jus Mangga"
  65.             print "c. Jus Melon"
  66.             print "d. Kebali"
  67.             if (pil_mnm=="a"):
  68.                 print "Anda memilih Jus Kedondong"
  69.                 input " "
  70.             elif(pil_mnm=="b"):
  71.                 print "Anda memilih Jus Mangga"
  72.                 input " "
  73.             elif(pil_mnm=="c"):
  74.                 print "Anda Jus Melon"
  75.                 input " "
  76.             elif(pil_mnm=="d"):
  77.                 break
  78.             else:
  79.                  print "Pilih a,b,c,d"
  80.                  input " "
  81.     elif (pil=="3"):
  82.         print "Terimakasih"
  83.         break
  84.     else:
  85.         print "Pilihan 1,2,3"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top