<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Glory Odeyemi on Medium]]></title>
        <description><![CDATA[Stories by Glory Odeyemi on Medium]]></description>
        <link>https://medium.com/@glowcodes?source=rss-be575196af21------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5mUkvpgDgddSBHZcGixezQ.jpeg</url>
            <title>Stories by Glory Odeyemi on Medium</title>
            <link>https://medium.com/@glowcodes?source=rss-be575196af21------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:57:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@glowcodes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Day 2 — Tip Calculator]]></title>
            <link>https://glowcodes.medium.com/day-2-tip-calculator-684c63a0b905?source=rss-be575196af21------2</link>
            <guid isPermaLink="false">https://medium.com/p/684c63a0b905</guid>
            <category><![CDATA[tip-calculator]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[100daysofcode]]></category>
            <dc:creator><![CDATA[Glory Odeyemi]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 17:25:57 GMT</pubDate>
            <atom:updated>2023-11-03T17:32:03.102Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 2 — Tip Calculator💵🤑</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*LSRLKHvabicXImWrIx9Ptw.png" /><figcaption>Image from <a href="https://www.culinaryschools.org/tip-calculator/">https://www.culinaryschools.org/tip-calculator/</a></figcaption></figure><p>If you are the type of person who always enjoys friends’ night/day out and has to tip and split the bill amongst yourself, then stick with me; you will find this very helpful. In this article, I will be giving a detailed step-by-step approach to coding your very own tip calculator.</p><p>This article is part of a series, and if you have yet to check out the <a href="https://glowcodes.medium.com/day-1-band-name-generator-50c27368c7be">previous article — Day 1</a>, you probably should because we covered some fundamental topics in Python that would be instrumental in this project. If you are reading this further, I am assuming you have already, and you are good to go. In that case, let’s do this.</p><p>Just as the title implies, the goal of this project is to create a tip calculator that accepts the total bill, tip percentage, and number of people splitting the bill as input and then returns the amount each person is to pay. Pretty simple, right? To achieve this, we will cover the following Python basics — Data types, Type checking, Type casting, Arithmetic operators, Number manipulation, and F-strings.</p><h3>Data types, Type checking, and Type casting</h3><p>In Python, data types are used to define the type of a variable, and for this project, we will be looking at just three of them — integer, float, and string. You should be familiar with the string data type already, but just as a reminder, they are text data types usually denoted by either single quotation marks &#39;&#39; or double quotation marks &quot;&quot; . Integer and float are numeric data types, and below is the syntax.</p><pre>age = 20  # I am an integer (int)<br>pi = 3.14  # I am a float</pre><blockquote>int - holds signed integers of non-limited length.</blockquote><blockquote>float - holds floating decimal points and it&#39;s accurate up to 15 decimal places.</blockquote><p>When declaring a variable in Python, we do not specify the data type, so it is essential to know how to check the type of your variable, especially when you are unsure, and we can do this using the type() function.</p><pre>type(&quot;Hello, world!&quot;)  # returns &lt;class &#39;str&#39;&gt;, i.e., type string<br>type(123)  # returns &lt;class &#39;int&#39;&gt;, i.e., type integer<br>type(2.8)  # returns &lt;class &#39;float&#39;&gt;, i.e., type float<br>type(age)  # returns &lt;class &#39;int&#39;&gt; because we previously declared age as 20.</pre><p>What if we want to change our variable from one type to another? This is called type casting in Python, and we can do that just as quickly using the syntax below.</p><pre>age = &quot;20&quot;  # a string<br>new_age = int(age)  # changes the string to an integer.num1 = 2  # an integer<br><br>num1 = 2  # an integer<br>num2 = float(num1)  # becomes 2.0, i.e, the type has been changed to a float.</pre><p>Let us now see how this will help us create our tip calculator.</p><pre># accept the total bill as input<br>total_bill = float(input(&quot;What is the total bill? &quot;))<br># accept the tip percentage as input<br>tip_percent = int(input(&quot;How many percent tip are you offering - 10, 12, or 15? &quot;))<br># finally, accept the number of people splitting the bill as input<br>num_of_people = int(input(&quot;How many people are splitting the bill? &quot;))</pre><p>You can probably already see Python’s typecasting in action because the input() function returns user input as a string, which makes it necessary to change the type so it is suitable for us to work with.</p><h3>Arithmetic &amp; Assignment Operators</h3><p>Operators in Python are used to perform operations on variables and values, and there are different types of operators, including arithmetic operators, assignment operators, logical operators, etc. Our focus is on the assignment and arithmetic operators.</p><p>Arithmetic operators are used with numeric values to perform everyday mathematical operations. They include: -, +, *, /, %, **, and //.</p><pre>addition = 2 + 2  # 4<br>substraction = 2 - 2  # 0<br>multiplication = 2 * 2  # 4<br>division = 2 / 2  # 1<br>modulus = 2 % 2  # 0 - divides the number and return the remainder.<br>exponentiation = 2 ** 3  # 8<br>floor_division = 15 // 2  # 7 - rounds the result down to the nearest whole number.</pre><p>Assignment operators are used to assign values to variables, and although we haven’t explicitly stated it, we have encountered an assignment operator — =. Others include: -=, +=, *=, /=, %=, **=, //=, etc. We would only discuss the listed operators in this article.</p><pre>a = 2  # assigns 2 to a<br>a += 2  # 4, same as a = a + 2, adds 2 to a and a becomes 4.<br>a -= 2  # 0, same as a = a - 2, subtracts 2 from a and a becomes 0.<br>a *= 2  # 4, same as a = a * 2, multiply 2 and a and a becomes 4.<br>a /= 2  # 1, same as a = a / 2, divides a by 2 and a becomes 1.<br>a %= 2  # 0, same as a = a % 2, divides a by 2 and a becomes the remainder 0.<br>a **= 3  # 8, same as a = a ** 3, raise a to the power of 3 and a becomes 8.<br>a //= 2  # 1, same as a = a // 2, divides a by 2 and a becomes 1 instead of 1.0.</pre><p>With this new knowledge, we can now calculate the tip amount and the amount each person will pay. Let’s implement that in our tip calculator.</p><pre># calculate the tip amount<br>tip_amount = tip_percent / 100  # divide the tip percent by 100<br>tip_amount *= total_bill  # multiply the tip amount with the total bill<br>total_bill += tip_amount  # add the tip amount to the total bill.<br><br># calculate the amount each person will pay<br># divide the total bill by the number of people paying<br>individual_bill = total_bill / num_of_people</pre><p>Now that we have calculated the amount each person will pay, all that is left is to display the amount. However, we still need to cover one more topic to help us show the correct amount.</p><h3>Number manipulation &amp; F-strings</h3><p>When carrying out divisions in Python, the results are always returned in floating decimal points, which can be up to 15 decimal points, so it is necessary to know how to round them to the desired number. One way of doing this is with the round() function.</p><pre>x = 10 / 3  # returns 3.33333...<br>rounded_x = round(x, 2)  # returns 3.33<br>num = round(x)  # returns 3</pre><blockquote>round() - returns a float number that will be rounded to the decimal places which are given as input. If the decimal places to be rounded are not specified, it is considered as 0, and it will round to the nearest integer.</blockquote><p>Another way of manipulating floating point numbers is with the F-string. Apart from this, it provides a concise and convenient way to embed Python expressions inside string literals for formatting.</p><pre>x = 10 / 3<br>print(f&quot;10 / 3 = {x:.2f}&quot;) # this displays 10 / 3 = 3.33</pre><blockquote>To create an f-string, prefix the string with the letter “ f ”.</blockquote><blockquote>:.2f formats the number to 2 decimal places.</blockquote><p>I believe we now have all we need to complete our tip calculator. We had to learn number manipulation first because we didn’t want to display the amount each person would pay as a floating point number with more than two decimal places. It’s not like you have ever seen a bill of $50.345 😅.</p><pre># display the amount<br>print(f&quot;Each person is paying: ${individual_bill:.2f}&quot;)</pre><p>We have created a tip calculator using data types, type casting, assignment and arithmetic operators, and f-string. Let’s combine all the codes.</p><pre># accept the total bill as input<br>total_bill = float(input(&quot;What is the total bill? &quot;))<br># accept the tip percentage as input<br>tip_percent = int(input(&quot;How many percent tip are you offering - 10, 12, or 15? &quot;))<br># finally, accept the number of people splitting the bill as input<br>num_of_people = int(input(&quot;How many people are splitting the bill? &quot;))<br><br># calculate the tip amount<br>tip_amount = tip_percent / 100  # divide the tip percent by 100<br>tip_amount *= total_bill  # multiply the tip amount with the total bill<br>total_bill += tip_amount  # add the tip amount to the total bill.<br><br># calculate the amount each person will pay<br># divide the total bill by the number of people paying<br>individual_bill = total_bill / num_of_people<br><br># display the amount<br>print(f&quot;Each person is paying: ${individual_bill:.2f}&quot;)</pre><p>The output should look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*D6Geyxg0kJllY2av" /><figcaption>Image from author</figcaption></figure><p>Yay!!! Our tip calculator is ready for use. Next time, you don’t have to stress about using your phone calculator when you go out with your friends or partner😉; you can use your tip calculator. What a lifesaver!</p><h3>Conclusion</h3><p>You have come a long way, and that is wonderful. The basic information you learned will benefit your Python coding journey, so practice it often. Feel free to customize your tip calculator whichever way you want or add additional features. Test the tip calculator below or view the complete code.</p><p><a href="https://github.com/gloryodeyemi/100daysOfPython/blob/main/Day2/Tip_Calculator.ipynb">100daysOfPython/Day2/Tip_Calculator.ipynb at main · gloryodeyemi/100daysOfPython</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Freplit.com%2F%40GloryOdeyemi%2FTip-Calculator%3Fembed%3Dtrue&amp;display_name=replit&amp;url=https%3A%2F%2Freplit.com%2F%40GloryOdeyemi%2FTip-Calculator%3Fembed%3Dtrue&amp;image=https%3A%2F%2Freplit.com%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=replit" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/6896f8d80cd46b5562d6783d447cc28e/href">https://medium.com/media/6896f8d80cd46b5562d6783d447cc28e/href</a></iframe><p>See you next time!</p><h3>References</h3><ol><li><a href="https://www.w3schools.com/python/python_operators.asp">Python operators</a></li><li><a href="https://www.geeksforgeeks.org/formatted-string-literals-f-strings-python/">F-strings in Python</a></li><li><a href="https://www.programiz.com/python-programming/variables-datatypes">Python data types</a></li><li><a href="https://www.geeksforgeeks.org/round-function-python/">round() function in Python</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=684c63a0b905" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 1 — Band Name Generator]]></title>
            <link>https://glowcodes.medium.com/day-1-band-name-generator-50c27368c7be?source=rss-be575196af21------2</link>
            <guid isPermaLink="false">https://medium.com/p/50c27368c7be</guid>
            <category><![CDATA[band-name-generator]]></category>
            <category><![CDATA[100daysofcode]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Glory Odeyemi]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 15:16:28 GMT</pubDate>
            <atom:updated>2023-10-20T15:16:28.028Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 1 — Band Name Generator</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KipUZHzR9RK2-9hhKl1xHQ.png" /><figcaption>Image from <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fbrandnamegenerator.com%2F&amp;psig=AOvVaw1dRqTvWrBD89WPsiCuruQ1&amp;ust=1697900432659000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBEQjRxqFwoTCNjvmJPyhIIDFQAAAAAdAAAAABAK">here</a>.</figcaption></figure><p>I recently started taking the Udemy <a href="https://www.udemy.com/course/100-days-of-code/">100 Days of Code: The Complete Python Pro Bootcamp for 2023</a> course, and in this series, I will be providing my solutions to the challenges and projects. So sit back and enjoy the ride!</p><p>The goal of the first project — Band Name Generator, is to generate a band name using the city and pet name provided by the user. To achieve this, we will cover four topics in the Python programming language: comments, input()function, print() function, string manipulation, and variables.</p><h3>Comments, Variables &amp; input() Function</h3><p>The input() function allows input from the user and returns it as a string, and you can view a variable as a memory location where a value is stored. Comments allow you to explain your code or make it more readable, and it does not affect the output of your code, i.e., Python does not execute a comment with the rest of your code. Below is the syntax for Python&#39;s input() function, comment, and variable.</p><pre># I am a comment<br>name = input(&quot;Enter your name: &quot;)</pre><blockquote>name - represents the variable storing the input gotten from the user</blockquote><blockquote>&quot;Enter your name: &quot; - represents the input prompt. A default message displayed before the user input.</blockquote><blockquote># I am a comment - represents a Python comment. It usually starts with a # symbol.</blockquote><p>Now that we know Python&#39;s input() function, comment, and variable, let&#39;s apply them to our project.</p><p>The first step in creating our band name generator is to ask the user for the city they grew up in and the name of a pet.</p><pre># Ask the user for the city that they grew up in.<br>city = input(&quot;What city did you grow up in?\n&quot;)<br><br># Ask the user for the name of a pet.<br>pet = input(&quot;What is the name of a pet?\n&quot;)</pre><p>The code above allows the user to enter the city they grew up in and the name of a pet, which is then stored in the city and pet variables respectively.</p><h3>String Manipulation and print() Function</h3><p>The Python print() function displays a specified message to the screen or output device. Strings are usually denoted by either single quotation marks &#39;&#39; or double quotation marks &quot;&quot;.</p><pre># Syntax for a string<br>my_string1 = &quot;I am a string&quot;<br>my_string2 = &#39;I am also a string&#39;<br><br># String manipulation - concatenation<br>my_string = my_string1 + &quot; and &quot; + my_string2<br><br># Syntax for the print() function<br>print(my_string)</pre><p>When the above code is executed, I am a string and I am also a string will be displayed as an output because of the print() function. The + operator is used to concatenate, i.e., combine two strings. Let&#39;s apply this new knowledge to our project.</p><pre># Combine the name of their city and pet and show them their band name.<br>band_name = city + &quot; &quot; + pet<br>print(&quot;Your band name is: &quot; + band_name)</pre><p>We have been able to generate a band name from the user’s city and a pet name using Python input() and print() functions, variables, and string concatenation. Let&#39;s combine all the codes.</p><pre># Ask the user for the city that they grew up in.<br>city = input(&quot;What city did you grow up in?\n&quot;)<br><br># Ask the user for the name of a pet.<br>pet = input(&quot;What is the name of a pet?\n&quot;)<br><br># Combine the name of their city and pet and show them their band name.<br>band_name = city + &quot; &quot; + pet<br>print(&quot;Your band name is: &quot; + band_name)</pre><p>The output of the code will look like;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*P7JdKxoCi8ifsa2pCNrGvg.png" /><figcaption>Image from author</figcaption></figure><p>We now have our band name, and if you happen to see Major Snoopy topping the charts, just know I have decided to start a band and given it that name😅.</p><h3>Conclusion</h3><p>If you made it this far, I commend your determination to learn, and I appreciate you sticking with me. With the new knowledge you have, feel free to customize your code. You can test the band name generator below or view the complete code.</p><p><a href="https://github.com/gloryodeyemi/100daysOfPython/blob/main/Day1/Band_Name_Generator.ipynb">100daysOfPython/Day1/Band_Name_Generator.ipynb at main · gloryodeyemi/100daysOfPython</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Freplit.com%2F%40GloryOdeyemi%2FBand-Name-Generator%3Fembed%3Dtrue&amp;display_name=replit&amp;url=https%3A%2F%2Freplit.com%2F%40GloryOdeyemi%2FBand-Name-Generator%3Fembed%3Dtrue&amp;image=https%3A%2F%2Freplit.com%2Fpublic%2Fimages%2Freplit-logo-800x600.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=replit" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/606a7e9d7185ec4daf2332a9fa677a0b/href">https://medium.com/media/606a7e9d7185ec4daf2332a9fa677a0b/href</a></iframe><p>Have fun coding your band name generator. See you in the next one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50c27368c7be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bank Institution Term Deposit Predictive Model]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/bank-institution-term-deposit-predictive-model-83afe1d2b08c?source=rss-be575196af21------2"><img src="https://cdn-images-1.medium.com/max/2426/1*RVPRxqz2VUuY7NGXSXzmtw.jpeg" width="2426"></a></p><p class="medium-feed-snippet">A step by step approach</p><p class="medium-feed-link"><a href="https://medium.com/data-science/bank-institution-term-deposit-predictive-model-83afe1d2b08c?source=rss-be575196af21------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/bank-institution-term-deposit-predictive-model-83afe1d2b08c?source=rss-be575196af21------2</link>
            <guid isPermaLink="false">https://medium.com/p/83afe1d2b08c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[term-deposits]]></category>
            <category><![CDATA[predictive-model]]></category>
            <dc:creator><![CDATA[Glory Odeyemi]]></dc:creator>
            <pubDate>Wed, 02 Sep 2020 02:30:14 GMT</pubDate>
            <atom:updated>2020-09-02T03:43:08.939Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Twitter Data Mining — Measuring Users’ Influence]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/twitter-data-mining-measuring-users-influence-ef76c9badfc0?source=rss-be575196af21------2"><img src="https://cdn-images-1.medium.com/max/1440/1*WvRNsIytQdT3WFLo4PR4dQ.png" width="1440"></a></p><p class="medium-feed-snippet">Followers and Influence; A Scientific Insight</p><p class="medium-feed-link"><a href="https://medium.com/data-science/twitter-data-mining-measuring-users-influence-ef76c9badfc0?source=rss-be575196af21------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/twitter-data-mining-measuring-users-influence-ef76c9badfc0?source=rss-be575196af21------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef76c9badfc0</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[twitter-data]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Glory Odeyemi]]></dc:creator>
            <pubDate>Fri, 24 Jul 2020 19:42:11 GMT</pubDate>
            <atom:updated>2020-07-27T23:10:39.461Z</atom:updated>
        </item>
    </channel>
</rss>