Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "# To find the percentage"
  8. ]
  9. },
  10. {
  11. "cell_type": "code",
  12. "execution_count": null,
  13. "metadata": {},
  14. "outputs": [],
  15. "source": [
  16. "#let us assume a few subject marks"
  17. ]
  18. },
  19. {
  20. "cell_type": "code",
  21. "execution_count": null,
  22. "metadata": {},
  23. "outputs": [],
  24. "source": [
  25. "print(\"enter number of subjects\")\n",
  26. "n=int(input())"
  27. ]
  28. },
  29. {
  30. "cell_type": "code",
  31. "execution_count": null,
  32. "metadata": {},
  33. "outputs": [],
  34. "source": [
  35. "total=0\n",
  36. "for i in range(n):\n",
  37. " i=int(input(\"enter subject marks\"))\n",
  38. " total=i+total\n",
  39. "print(\"total = \", total)\n",
  40. "percentage = total/n\n",
  41. "print(\"percentage =\",percentage,\"%\")"
  42. ]
  43. },
  44. {
  45. "cell_type": "code",
  46. "execution_count": null,
  47. "metadata": {},
  48. "outputs": [],
  49. "source": []
  50. },
  51. {
  52. "cell_type": "code",
  53. "execution_count": null,
  54. "metadata": {},
  55. "outputs": [],
  56. "source": []
  57. },
  58. {
  59. "cell_type": "code",
  60. "execution_count": null,
  61. "metadata": {},
  62. "outputs": [],
  63. "source": []
  64. }
  65. ],
  66. "metadata": {
  67. "kernelspec": {
  68. "display_name": "Python 3",
  69. "language": "python",
  70. "name": "python3"
  71. },
  72. "language_info": {
  73. "codemirror_mode": {
  74. "name": "ipython",
  75. "version": 3
  76. },
  77. "file_extension": ".py",
  78. "mimetype": "text/x-python",
  79. "name": "python",
  80. "nbconvert_exporter": "python",
  81. "pygments_lexer": "ipython3",
  82. "version": "3.6.7"
  83. }
  84. },
  85. "nbformat": 4,
  86. "nbformat_minor": 4
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement