Day 10 of 100 Days of Python Code: Functions with Outputs and Building a Calculator App ๐งฎ๐ฑ
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! ๐๐ป๐