Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions Kodify_by_IFZA_SHAD_.ipynb
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
}
]
}