Advertisement
mercode

for ciklus

Jan 19th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #for ciklus
  2. for szam in range(10):
  3.     print(szam)
  4. print("vege a ciklusnak")
  5.  
  6. #for cikus stringen
  7. for nev in "Szilard":
  8.     print(nev)
  9. print("Ciklus vége")
  10.  
  11. #BREAK
  12. for szam in range(10):
  13.     print(szam)
  14.     break #elso szam utána kilép a ciklusbol
  15. print("vege a ciklusnak")
  16.  
  17. # 5 elem utan kilep:
  18. for szam in range(10):
  19.     if szam==5:
  20.         break
  21.     print(szam)
  22. print("vege a ciklusnak")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement