<?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 Adit g on Medium]]></title>
        <description><![CDATA[Stories by Adit g on Medium]]></description>
        <link>https://medium.com/@aditg0209?source=rss-f85cf5b226b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XCBRtOqWKe6_rccp</url>
            <title>Stories by Adit g on Medium</title>
            <link>https://medium.com/@aditg0209?source=rss-f85cf5b226b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 20:10:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aditg0209/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[Coding a calculator in html, css and javascript]]></title>
            <link>https://medium.com/@aditg0209/coding-a-calculator-in-html-1e6fc92fea1e?source=rss-f85cf5b226b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e6fc92fea1e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html-css]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[calculator]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Adit g]]></dc:creator>
            <pubDate>Sat, 06 Apr 2024 12:08:05 GMT</pubDate>
            <atom:updated>2024-04-06T12:25:58.699Z</atom:updated>
            <content:encoded><![CDATA[<p>Calculators are used to solve arithmetic problems. A simple calculator can be built using html, css and javascript, without the use of additional programs.</p><p>Step 1: The first step is to create a basic html structure called “skeleton”.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;title&gt;Title goes here&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    ...<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Step 2: Create a structure for the calculator. This step creates the screen and buttons.</p><pre>&lt;!-- Calculator Body --&gt;<br>&lt;div class=&quot;calc-body&quot;&gt;<br>    &lt;!-- Calculator Display Screen --&gt;<br>    &lt;div class=&quot;calc-screen&quot; id=&quot;calc-screen&quot;&gt;<br>        &lt;div id=&quot;calc-operation&quot;&gt;0&lt;/div&gt;<br>        &lt;div id=&quot;calc-typed&quot;&gt;0&lt;/div&gt;<br>    &lt;/div&gt;<br>    &lt;!-- Calculator Buttons --&gt;<br>    &lt;div class=&quot;calc-button-row&quot;&gt;<br>        &lt;button class = &quot;ac&quot;&gt;AC&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#43;&amp;#47;&amp;#8722;&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;x^&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#247;&lt;/button&gt;<br>        &lt;button&gt;7&lt;/button&gt;<br>        &lt;button&gt;8&lt;/button&gt;<br>        &lt;button&gt;9&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#215;&lt;/button&gt;<br>        &lt;button&gt;4&lt;/button&gt;<br>        &lt;button&gt;5&lt;/button&gt;<br>        &lt;button&gt;6&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#8722;&lt;/button&gt;<br>        &lt;button&gt;1&lt;/button&gt;<br>        &lt;button&gt;2&lt;/button&gt;<br>        &lt;button&gt;3&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#43;&lt;/button&gt;<br>        &lt;button&gt;0&lt;/button&gt;<br>        &lt;button&gt;.&lt;/button&gt;<br>        &lt;button&gt;&amp;#9003;&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&quot;&gt;&amp;#61;&lt;/button&gt;<br>        &lt;!-- The symbols () are html codes for special symbols that are not found on a computer. --&gt;<br>        &lt;!-- The class attributes are used to specify which css class do the elements belong so that they can be given the same css properties simultaneously --&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Step 3: Make the css part. Make sure to put the code in a &lt;style&gt; tag.</p><pre>/* The border has been managed in every fourth button so that the design will not distract. */<br>.calc-button-row button:nth-child(4n) {<br>    border-right: none;<br>}<br>/* This is the only necessary part. If you want to add additional css properties then you may do so, or use this as a reference*/<br>.calc-body {<br>    width: 275px;<br>    margin: auto;<br>    min-height: 400px;<br>    box-shadow: 0 8px 50px -7px black;<br>    background: #3A4655;<br>}<br><br>/* Calculator Display Screen */<br>.calc-screen {<br>    padding: 1rem;<br>}<br><br>#calc-operation {<br>    font-size: 1.3rem;<br>    text-align: right;<br>    color: #727B86;<br>    padding-bottom: .5rem;<br>}<br><br>#calc-typed {<br>    font-size: 2rem;<br>    text-align: right;<br>    color: #fff;<br>}<br><br>/* Calculator Buttons */<br>.calc-button-row {<br>    display: table;<br>}<br><br>.calc-button-row button {<br>    display: table-cell;<br>    width: 25%;<br>    background: #425062;<br>    color: #fff;<br>    height: 65px;<br>    font-size: 1.3rem;<br>    border: none;<br>    border-color: #3C4857;<br>    border-width: 1px 1px 0px 0;<br>    border-style: solid;<br>}<br><br>.calc-button-row button.ac {<br>    color: #ff7665;<br>}<br><br>.calc-button-row button.opt {<br>    color: #ffbc56;<br>}<br><br>.calc-button-row button:active {<br>    position: relative;<br>    top: 1px;<br>}<br><br>.calc-button-row button:hover {<br>    background: #3e4b5c;<br>}</pre><p>Now it’s time for the main part — Javascript.</p><p>Step 4: Make a function so that each time a button is pressed, the symbol on the button appears on the screen.</p><pre>var x = document.getElementById(&quot;calc-typed&quot;);<br>function conc(val) {<br>        if (x.textContent == &quot;0&quot;){<br>            x.innerHTML = val;<br>         } else {<br>            x.innerHTML = x.innerHTML + val;<br>         }<br>}</pre><pre>        &lt;button onclick=&quot;conc(7)&quot;&gt;7&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(8)&quot;&gt;8&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(9)&quot;&gt;9&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#215;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(4)&quot;&gt;4&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(5)&quot;&gt;5&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(6)&quot;&gt;6&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#8722;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(1)&quot;&gt;1&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(2)&quot;&gt;2&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(3)&quot;&gt;3&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#43;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(0)&quot;&gt;0&lt;/button&gt;<br>        &lt;!-- Modify all the html elements to have onclick attributes, along with the functions--&gt;</pre><p>Note that this only works with numbers, since there cannot be 2 operators one after the other, so we create a separate function for operators.</p><pre>function testSign(w){<br>  var z = x.textContent;<br>  if ((z.charAt(z.length - 1) != &quot;+&quot; &amp;&amp; z.charAt(z.length - 1) != &#39;-&#39; &amp;&amp; z.charAt(z.length - 1) != &#39;×&#39; &amp;&amp; z.charAt(z.length - 1) != &#39;÷&#39; &amp;&amp; z.charAt(z.length - 1) != &#39;.&#39;) || z.length == 1){<br>       if (z != &#39;0&#39;){<br>             conc(w);<br>       }<br>  }<br>}</pre><pre>        &lt;button class = &quot;ac&quot;&gt;AC&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot;&gt;&amp;#43;&amp;#47;&amp;#8722;&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot; onclick=&quot;testSign(&#39;**&#39;)&quot;&gt;x^&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot; onclick=&quot;testSign(&#39;/&#39;)&quot;&gt;&amp;#247;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(7)&quot;&gt;7&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(8)&quot;&gt;8&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(9)&quot;&gt;9&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot; onclick=&quot;testSign(&#39;*&#39;)&quot;&gt;&amp;#215;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(4)&quot;&gt;4&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(5)&quot;&gt;5&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(6)&quot;&gt;6&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot; onclick=&quot;testSign(&#39;-&#39;)&quot;&gt;&amp;#8722;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(1)&quot;&gt;1&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(2)&quot;&gt;2&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(3)&quot;&gt;3&lt;/button&gt;<br>        &lt;button class=&quot;opt&quot; onclick=&quot;testSign(&#39;+&#39;)&quot;&gt;&amp;#43;&lt;/button&gt;<br>        &lt;button onclick=&quot;conc(0)&quot;&gt;0&lt;/button&gt;</pre><p>Step 5: Coding for decimal points: Coding decimal points are slightly different from coding operators normally. But since you cannot have 2 decimal points for 1 number, a slightly different function has to be made.</p><pre>            function dot(){<br>                var split = x.textContent.split(&quot;&quot;); //splits text into a list consisting of individual letters<br>                var rev = split.reverse(); //reverses the list<br>                var reversed = rev.join(&quot;&quot;); //joins the list contents back into a string<br>                forLoop:for (var j = 1; j &lt; reversed.length ; j++){ //a label has been kept in for this loop, called forLoop<br>                    //Iterates through the string till a dot is found<br>                        if(reversed.charAt(j) != &quot;.&quot;){<br>                        if(reversed.charAt(j) == &quot;+&quot; || reversed.charAt(j) == &quot;-&quot; || reversed.charAt(j) == &quot;×&quot; || reversed.charAt(j) == &quot;÷&quot;){<br>                            conc(&quot;.&quot;) // any mathematical operator means that<br>                        } else if (reversed.charAt(j + 1) == &quot;.&quot;){<br>                            j = reversed.length;<br>                            break forLoop; //does not execute because there is already a decimal point<br>                            //breaks the entire loop<br>                        } else if(!reversed.includes(&quot;.&quot;)) {<br>                            conc(&quot;.&quot;) //If there are no operators or dots then it executes as normal<br>                        } else {<br>                            continue; //continues till a dot/operator is found<br>                        }<br>                    }<br>                }<br>//make sure to add the onclick attribute along with each function name for the respective signs</pre><p>Step 6: Now we can’t go back once we type in a symbol, so a cancel button is required.</p><pre>        function removeLastChar(){<br>            var c = &quot;&quot;;<br>            for(let i = 1; i &lt; x.textContent.length; i++){<br>                c = c.concat(x.textContent.charAt(i - 1))<br>            } //Concatenates c to all the symbols in the screen except for the last letter<br>            if (c == &quot;&quot;){<br>                x.innerHTML = &#39;0&#39;; //if c = 0 then return 0<br>            } else {<br>                x.innerHTML = c //if c!= 0 then return c<br>            }<br>        }</pre><p>Step 7: We can’t keep pressing the back button to remove all values, so to make it more convenient we have a button called ‘AC’, and by pressing it all the values are removed from the calculator. It is actually very simple to implement.</p><pre>        function clearDisplay(){<br>            x.innerHTML = &quot;0&quot;;<br>            document.getElementById(&#39;calc-operation&#39;).innerHTML = &quot;0&quot;;<br>        }</pre><p>Step 8: Now we need to make the calculator functional. To do that, we have the the built-in eval() function in javascript.</p><pre>var currentOperator;       <br>            function calculate() {<br>                var expression = currentOperator ? currentOperator + x.textContent : x.textContent;<br>                try { //this is very important as a calculator function can catch many errors, like the ZeroError, which states that a number cannot be divided by 0<br>                    document.getElementById(&#39;calc-operation&#39;).innerHTML = x.textContent; //replace the value in the history section with the current value<br>                    x.innerHTML = eval(expression); //main calculation                    console.log(Math.ceil(x.textContent.length /16) * 101.6)<br>                } catch (error) {<br>                    x.innerHTML = &quot;Error&quot;;<br>            }</pre><p>Step 9: There is a special feature in most calculators which allow you to change positive signs with negative signs. This is not necessarily important but we can add it anyway.</p><pre>        function changeSign(){<br>            if (x.textContent.charAt(x.textContent.length - 1) == &#39;+&#39;){<br>                removeLastChar();<br>                x.innerHTML = x.textContent + &#39;-&#39;<br>            } else if (x.textContent.charAt(x.textContent.length - 1) == &#39;-&#39;){<br>                removeLastChar();<br>                x.innerHTML = x.textContent + &#39;+&#39;<br>            }<br>        }</pre><p>Now you have a finished calculator, made from just a HTML, CSS and JavaScript. This is how the final output should look like:</p><figure><img alt="Calculator with buttons and screen showing two zeroes, one on top of the other" src="https://cdn-images-1.medium.com/max/546/1*tTWdgTmEsELa23T5DKVh4g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e6fc92fea1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding complex exponentiation in Python]]></title>
            <link>https://medium.com/@aditg0209/coding-complex-exponentiation-in-python-ae4fdf32bd78?source=rss-f85cf5b226b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae4fdf32bd78</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[exponent]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algebra]]></category>
            <dc:creator><![CDATA[Adit g]]></dc:creator>
            <pubDate>Sat, 30 Mar 2024 09:31:03 GMT</pubDate>
            <atom:updated>2024-03-30T10:04:30.063Z</atom:updated>
            <content:encoded><![CDATA[<p>Algebra is a hard concept, and can be tough when complicating problems, the same way most schools do when it comes to teaching something as simple as exponentiating sums of variables. Even something as simple as the sum of 2 variables, usually a and b.</p><p>Students are taught to calculate (a + b)² in a very difficult way, which is multiplying (a + b) and (a + b)</p><p>But there is a simpler way, which involves a basic concept taught to kids in kindergarten — The number pyramid.</p><p>If you might have forgotten, the number pyramid basically takes two numbers at the top of the pyramid, adds them and puts the new number at the bottom. It goes like this.</p><pre>                                  1<br>                                1   1<br>                              1   2   1<br>                            1   3   3   1<br>                          1   4   6   4   1<br>                        1   5   10 10   5   1<br>and so on</pre><p>The numbers at the bottom are the sums of the two numbers at the top.</p><p>But they are actually the constant factors of the expression that forms when (a + b) is exponentiated by a number.</p><pre>(a + b)⁰ =                        1<br>(a + b)¹ =                      1   1<br>(a + b)² =                    1   2   1<br>(a + b)³ =                  1   3   3   1<br>(a + b)⁴ =                1   4   6   4   1<br>(a + b)⁵ =              1   5   10 10   5   1</pre><p>The first literal factor of (a + b)ˣ is always aˣ, and the next factor is aˣ times b/a and so on.</p><pre>(a + b)⁰ = 1<br>(a + b)¹ = 1a¹ + 1b¹<br>(a + b)² = 1a² + 2a¹b¹ + 1b²<br>(a + b)³ = 1a³ + 3a²b¹ + 3a¹b² + 1b³<br>(a + b)⁴ = 1a⁴ + 4a³b¹ + 6a²b² + 4a¹b³ + 1b⁴<br>(a + b)⁵ = 1a⁵ + 5a⁴b¹ + 10a³b² + 10a²b³ + 5a¹b⁴ +  1b⁵</pre><p>Now we can start implementing it in python, to create a mini wolfram alpha, a system of algorithms that can solve algebra problems.</p><p>Step 1: Start by asking for user input and initializing all the variables.</p><pre>a = int(input(&quot;(a + b)^&quot;)) #user enters the exponent<br>x = [] #The use of these lists will be explained later<br>y = []<br>b = &quot;&quot; #This string outputs the final answer</pre><p>Step 2: Make a function which converts numbers to superscript.</p><pre>def get_super(z): <br>    normal = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-=()&quot;<br>    super_s = &quot;ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾQᴿˢᵀᵁⱽᵂˣʸᶻᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖ۹ʳˢᵗᵘᵛʷˣʸᶻ⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾&quot;<br>    #These consist of strings which hold input and output values<br>    res = z.maketrans(&#39;&#39;.join(normal), &#39;&#39;.join(super_s)) <br>    return z.translate(res)<br>    #Translates the input with the required value and returns the output</pre><p>Step 3: Make outputs for values that do not work with this program: If x equals to 0, 1 or 2, it may throw an error. To fix that, we can easily make separate codes for that</p><pre>if a == 0:<br>    print(&quot;1&quot;)<br>elif a == 1:<br>    print(&quot;a + b&quot;)<br>elif a == 2:<br>    print(&quot;a&quot; + get_super(&quot;2&quot;) + &quot; + 2ab + b&quot; + get_super(&quot;2&quot;))<br>#checks code if the value is 0, 1 or 2<br>else:<br>  pass<br>#main code will be here. Delete the pass later on.</pre><p>Step 4: Make a list for the constant factors.</p><pre>for i in range(0,a+1,1):<br>        if i == 0 or i == 1:<br>            x.append(&quot;1&quot;)<br>            y.append(&quot;1&quot;)<br>        # first value always equals to 1<br>        else:<br>            for j in range(1,i,1):<br>                x[j] = int(y[j-1]) + int(y[j])<br>                #In simple terms, this code uses the number pyramid to find values.<br>            x.append(&quot;1&quot;)<br>            #The last value also always equals to 1.<br>            y.clear()<br>            y.extend(x)<br>            #The reason why we use 2 different lists is because we inspect the first list, x, but since it gets modified, we store the old value of x in a separate list called y. </pre><p>Step 5: Multiply each value of the list with the corresponding literal values.</p><pre>  for k in range(0,len(x),1):<br>        if k == 0:<br>            b += &quot;a&quot; + get_super(str(a)) + &quot; + &quot;<br>        #First value always contains the first literal<br>        elif k == len(x) - 1:<br>            b += &quot;b&quot; + get_super(str(a))<br>        #Last value always contains the last literal<br>        elif k == 1:<br>            b += str(x[k]) + &quot;a&quot; + get_super(str(a-k)) + &quot;b + &quot;<br>        elif len(x) - k == 2:<br>            b += str(x[k]) + &quot;ab&quot; + get_super(str(k)) + &quot; + &quot;<br>        #These two conditions are done to omit powers of 1, which can just be represented by the variable itself<br>        else:<br>            b += str(x[k]) + &quot;a&quot; + get_super(str(a-k)) + &quot;b&quot; + get_super(str(k)) + &quot; + &quot;<br>        #If the following four conditions are not true, then the main code executes.</pre><p>Step 6: Print the final value, which is b</p><pre>print(b)</pre><p>Your code should be looking like this:</p><pre>a = int(input(&quot;(a + b)^&quot;))<br>x = []<br>y = []<br>b = &quot;&quot;<br>def get_super(z): <br>    normal = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-=()&quot;<br>    super_s = &quot;ᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾQᴿˢᵀᵁⱽᵂˣʸᶻᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖ۹ʳˢᵗᵘᵛʷˣʸᶻ⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾&quot;<br>    res = z.maketrans(&#39;&#39;.join(normal), &#39;&#39;.join(super_s)) <br>    return z.translate(res)<br>if a == 0:<br>    print(&quot;1&quot;)<br>elif a == 1:<br>    print(&quot;a + b&quot;)<br>elif a == 2:<br>    print(&quot;a&quot; + get_super(&quot;2&quot;) + &quot; + 2ab + b&quot; + get_super(&quot;2&quot;))<br>else:<br>    for i in range(0,a+1,1):<br>        if i == 0 or i == 1:<br>            x.append(&quot;1&quot;)<br>            y.append(&quot;1&quot;)<br>        else:<br>            for j in range(1,i,1):<br>                x[j] = int(y[j-1]) + int(y[j])<br>            x.append(&quot;1&quot;)<br>            y.clear()<br>            y.extend(x)<br>    for k in range(0,len(x),1):<br>        if k == 0:<br>            b += &quot;a&quot; + get_super(str(a)) + &quot; + &quot;<br>        elif k == len(x) - 1:<br>            b += &quot;b&quot; + get_super(str(a))<br>        elif k == 1:<br>            b += str(x[k]) + &quot;a&quot; + get_super(str(a-k)) + &quot;b + &quot;<br>        elif len(x) - k == 2:<br>            b += str(x[k]) + &quot;ab&quot; + get_super(str(k)) + &quot; + &quot;<br>        else:<br>            b += str(x[k]) + &quot;a&quot; + get_super(str(a-k)) + &quot;b&quot; + get_super(str(k)) + &quot; + &quot;<br>print(b)</pre><p>If, instead of (a + b)ˣ, it is (a - b)ˣ, simply use alternating signs starting from positive value, like this:</p><pre>(a - b)⁰ = 1<br>(a - b)¹ = 1a¹ - 1b¹<br>(a - b)² = 1a² - 2a¹b¹ + 1b²<br>(a - b)³ = 1a³ - 3a²b¹ + 3a¹b² - 1b³<br>(a - b)⁴ = 1a⁴ - 4a³b¹ + 6a²b² - 4a¹b³ + 1b⁴<br>(a - b)⁵ = 1a⁵ - 5a⁴b¹ + 10a³b² - 10a²b³ + 5a¹b⁴ - 1b⁵</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RxgCceTDCH7jDNNMjPtoEA.png" /></figure><p>This is how simple concepts can be used to solve complicated problems. The methods of exponentiation and simplified versions have been explained here. We have also created a python code specifically for calculating such problems. For an additional challenge, you can now try to make a program, but this time to calculate (a - b)ˣ instead of (a + b)ˣ.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae4fdf32bd78" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>