Advertisement
Alaa_Najmi

Get how many space string

Feb 14th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  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("لاتوجد مسافات")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement