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
16 changes: 7 additions & 9 deletions cs-python-loops-challenge.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
"source": [
"def squaresTo(num):\n",
" squares = 0\n",
" #add your code with the required loop here\n",
" \n",
"\n",
" for i in range(1,num+1):\n",
" squares+=i**2\n",
" # print(squares,i)\n",
" return squares"
]
},
Expand Down Expand Up @@ -157,9 +157,8 @@
"source": [
"def sumOfFactors(factor, num):\n",
" sumF=0\n",
" # add the loop here\n",
" \n",
" \n",
" for i in range(1,num+1):\n",
" sumF+=i+factor \n",
" return sumF"
]
},
Expand Down Expand Up @@ -197,9 +196,8 @@
"source": [
"def sumOfMultiplesOfTwoFactors(f1,f2,num):\n",
" sum2F = 0\n",
" #add your code with loop here\n",
" \n",
"\n",
" for i in range(1,num+1):\n",
" sum2F+=i+f1+f2\n",
" return sum2F\n",
" "
]
Expand Down