Advertisement
TristanSld

while loop and quit() function

Jan 7th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3. kullanici_adi="bayram"
  4. sifre="sude"
  5. while True:
  6.     kull_ad=raw_input("Kullanıcı adı: ")
  7.     sif=raw_input("Şifre: ")
  8.     if kull_ad==kullanici_adi and sif==sifre:
  9.         print "Programa hoşgeldiniz."
  10.         quit()
  11.     elif not kull_ad or not sif:
  12.         print "Bu alanlar boş bırakılamaz."
  13.     else:
  14.         print "Kullanıcı adı veya şifre yanlış."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement