Get how many space string

Alaa_Najmi Feb 14th, 2020 155 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string = "مرحبا انا استخدم لغة بايثون"
  2. count=0
  3. for i in string:
  4.     if (i.isspace()) == True:
  5.         count+=1
  6. if count != 0 :        
  7.      print(count)
  8. else:
  9.      print("لاتوجد مسافات")
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