Week 2: Python for Mathematicians

Week 2: Python for Mathematicians

  • This was an exciting second week as we studied how we can automate our problem solving process using loops and decisions. We looked into the use of decision conditions such as simple if statement, if else statements, if-elif-else statements.
  • The concepts of nested conditions along logical operators was used which is necessary to solve complex problems.
  • We then studied the concepts of loops (for, while) that helps us to repeat tasks which in return make our problem easy. We also had a look on the break, continue, pass statements.
  • These concepts were followed up by lectures in which we used our concepts to code interesting problems.



  • Specially, the mini project: "guess the number game" was a brilliant problem that we were asked to code.


Mini Project

Additionally, during this week I also presented some codes to few of my classmates. There were different programs that we discussed but one problem that I would like to mention is the famous problem (1+1/n)^n as n approaches to infinity. Its answer approaches to e.

import cmath
n=1

sum=(1+1/n)**n
error=cmath.e-sum
print('itr        e        approx        error')
print(f'{n}   {cmath.e}   {sum}    {error}')
while(error>0.01):
  n=n+1
  sum=(1+1/n)**n
  error=cmath.e-sum

  print(f'{n}   {cmath.e}   {sum}    {error}')
print(f'approx: {sum}')
print(f'original: {cmath.e}')
print(f'error: {error}')
print(f'n: {n}')        



Looking forward to the presentations coming up on weekend.

Special mention of our mentors:

Leader: Ma'am Afsheen Ghuman

Nice effort by Moderators: Ma'am Zartashia Afzal , Ma'am Shafaq Aslam

Special mentions: Ma'am Fatima Malik ,Sir Ubaid Ur Rehman

Special thanks: Dr. SARFRAZ AHMAD , DR. Zafar Shahid, PhD

Thank you iCodeGuru for providing us the platform.






Hassan Aftab Great recap of the whole week! ?? You have written this article nicely. Keep up the hard work.

Ubaid Ur Rehman

Software Engineer | Section Leader @ Stanford Code in Place | Moderator @ icodeGurru

4 个月

Keep up the good work

Shafaq Aslam

Student @Stanford CiP'24 | x-Lecturer | Python Instructor | Html | CSS | Python | C++

4 个月

Really proud of you. Well done. You showed great writing skills, just like in coding.

Afsheen Ghuman

Grad Assistant @GVSU || Silver ?? Brick at CALICO 2024 || Laravel Developer || Python || AI Enthusiast || LeetCoder || DSA/Leetcode Trainer & Moderator at @iCodeGuru || Computer Scientist

4 个月

Very well done... Keep going at the end of the session you will have added lots of new skills in your skill set. ????

Fatima Malik

WordPress Designer & Developer | WordsprintDevelopersHackathon Winner X2???? | CGPA 3.77/4.0 | Trainer @ iCodeGuru ??

4 个月

Very well summarised.. keep up your good work.

要查看或添加评论,请登录

Hassan Aftab的更多文章

社区洞察

其他会员也浏览了