diff --git a/Kodify_by_IFZA_SHAD_.ipynb b/Kodify_by_IFZA_SHAD_.ipynb new file mode 100644 index 0000000..b879e81 --- /dev/null +++ b/Kodify_by_IFZA_SHAD_.ipynb @@ -0,0 +1,114 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "collapsed_sections": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [], + "metadata": { + "id": "-waj4XPCLkoT" + } + }, + { + "cell_type": "markdown", + "source": [ + "**Recuritment Test by Kodify**\n", + "\n", + "**Q1**\n", + "\n", + "\n", + "**Find the sum of the digits in the number 100!**" + ], + "metadata": { + "id": "DO2PzRccLkqx" + } + }, + { + "cell_type": "code", + "source": [ + "import math" + ], + "metadata": { + "id": "qO69HM_ILyAy" + }, + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var_fact= math.factorial(100)\n" + ], + "metadata": { + "id": "hM2_TkqzL90m" + }, + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var_fact" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "B_ULOdVsMEB8", + "outputId": "498a10db-0af6-4aaa-a022-e73ea1d0c3f6" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "code", + "source": [ + "sum= 0\n", + "for digit in str(var_fact):\n", + " sum= sum+int(digit)\n", + "print(\"Sum of digit in the number of 100! is:\", sum)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Pizh5GiiMG5m", + "outputId": "2b30ecff-95ea-4850-eeb2-08c245a5afcb" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Sum of digit in the number of 100! is: 648\n" + ] + } + ] + } + ] +} \ No newline at end of file