Day 10 of 100 Days of Python Code: Functions with Outputs and Building a Calculator App ๐Ÿงฎ๐Ÿ“ฑ

Mirza Mohammed Baig
3 min readJul 3, 2024

--

Welcome to Day 1๏ธโƒฃ0๏ธโƒฃ of the 100 Days of Code Challenge. Today, we focused on learning about functions with outputs and applied our knowledge by building a Calculator App. Hereโ€™s a recap of everything we covered and accomplished:

Goals for the Day: ๐ŸŽฏ

- Master functions with outputs. ๐Ÿ’ก
- Develop a functional Calculator App.๐Ÿ“ฑ

Key Concepts Covered: ๐Ÿ”‘

Functions with Outputs: ๐Ÿ”„
We have previously learned about basic functions and functions with inputs. Today, we took it a step further and explored functions with outputs. Functions with outputs allow us to return data from a function, making our code more modular and reusable.

Multiple Return Values: ๐Ÿ”
We then learned how to return multiple values from a function. This is particularly useful when we need to get more than one piece of information from a function.

Docstrings: ๐Ÿงต
We learned about docstrings, which are a way to create documentation for our code. Docstrings are helpful for explaining what a function does and how to use it.

Calculator Part 1 โ€” Combining Dictionaries and Functions: ๐Ÿ“ฑ
In this part, we started building our Calculator App by combining dictionaries and functions. This allowed us to store operations and their corresponding functions in a dictionary for easy access.

Print vs Return: ๐Ÿ–จ๏ธ
We explored the differences between `print` and `return` statements. Understanding these differences is crucial for writing functions that can be reused and tested effectively.

While Loops, Flags, and Recursion: ๐Ÿ”„
We delved into while loops, flags, and recursion, which are powerful tools for controlling the flow of our programs and handling repeated tasks.

Interactive Coding Exercise โ€” Days in Month: ๐Ÿ“…

In this exercise, we created a program to determine the number of days in a given month, reinforcing our understanding of functions with outputs.

Auditorium Lesson:(https://app.auditorium.ai/lesson/eelyNMYJKXeNJAbjssSEQz0m88XvnhX6/79040aa6-f9d2-4493-9f92-52c26748ec3e?sl=c9278fb9-a6f0-492d-9547-fb79a3eadc76&st=xPEfb67hnFBbXQXPw9pBURtadKusnZIV)

Final Project: Calculator Finishing Touches and Bug Fixes

Finally, we added finishing touches and fixed bugs in our Calculator App, ensuring it runs smoothly and handles various edge cases.

Replit: ๐Ÿ’ป https://replit.com/@mbaig9/Day10100DaysofPython-MMB-Calculator#DAY10EXERCISES/V108D10CALCULATORFINAL.py

Github: ๐Ÿ’ปhttps://github.com/M1RZAB4IG/100DaysofPythonCodeChallenge/tree/main/Day10-Calculator

Lessons Learned: ๐Ÿ“š

- Functions with Outputs: Learned how to create functions that return values, making our code more modular and reusable. ๐Ÿ”„
- Multiple Return Values: Understood how to return multiple values from a function, which is useful for getting more information from a single function call. ๐Ÿ”
- Docstrings: Gained knowledge on using docstrings to document our code, making it easier to understand and maintain. ๐Ÿ“
- Print vs Return: Explored the differences between `print` and `return` statements, crucial for writing reusable and testable functions. ๐Ÿ–จ๏ธ
- While Loops and Recursion: Mastered controlling program flow using while loops and recursion, essential for handling repeated tasks and complex logic. ๐Ÿ”„

Summary: โœ…
Day 10 was a deep dive into functions with outputs and building a functional Calculator App. We started by understanding how to return values from functions, progressed through interactive exercises, and finally developed a Calculator App that incorporates dictionaries, functions, while loops, and recursion. This comprehensive approach reinforced our learning and provided a practical application for the concepts covered.

#Python #Coding #100DaysofPythonChallenge #Learning #Programming #Functions #CalculatorApp #Replit #Medium #SoftwareDevelopment

Stay tuned for more updates as I continue my coding journey! Feel free to connect and share your own coding journey! ๐Ÿš€๐Ÿ’ป๐Ÿ

--

--

Mirza Mohammed Baig
Mirza Mohammed Baig

Written by Mirza Mohammed Baig

A Muslim Man Pursuing Islamic Self-Improvement Interests: Islam | Self Improvement | SWE | Entrepreneurship | Digital Marketing