Guest User

Untitled

a guest
Dec 11th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "def lowercase_count(strng):\n",
  10. " count = 0 #initialize counter variable to zero\n",
  11. " #loop through string\n",
  12. " for character in strng:\n",
  13. " #check if tcharacter is a lowercase letter using islower() string method\n",
  14. " if character.islower():\n",
  15. " count = count + 1 #if the current character is a lowercase letter, increase count\n",
  16. " \n",
  17. " return count #After looping through all characters, return the count"
  18. ]
  19. }
  20. ],
  21. "metadata": {
  22. "kernelspec": {
  23. "display_name": "Python 3",
  24. "language": "python",
  25. "name": "python3"
  26. },
  27. "language_info": {
  28. "codemirror_mode": {
  29. "name": "ipython",
  30. "version": 3
  31. },
  32. "file_extension": ".py",
  33. "mimetype": "text/x-python",
  34. "name": "python",
  35. "nbconvert_exporter": "python",
  36. "pygments_lexer": "ipython3",
  37. "version": "3.6.6"
  38. }
  39. },
  40. "nbformat": 4,
  41. "nbformat_minor": 2
  42. }
Add Comment
Please, Sign In to add comment