<?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 Girolamo Pinto on Medium]]></title>
        <description><![CDATA[Stories by Girolamo Pinto on Medium]]></description>
        <link>https://medium.com/@girolamopinto1?source=rss-b18908656b3f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*WWSlk7l8OCQDcBXYIziWmg.jpeg</url>
            <title>Stories by Girolamo Pinto on Medium</title>
            <link>https://medium.com/@girolamopinto1?source=rss-b18908656b3f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:18:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@girolamopinto1/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[Emotion Detection in Python]]></title>
            <link>https://girolamopinto1.medium.com/emotion-detection-in-python-8642fade50a9?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8642fade50a9</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[emotion-detection]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[emotions]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Wed, 22 Jun 2022 08:04:54 GMT</pubDate>
            <atom:updated>2022-06-22T08:04:54.202Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to detect emotions on your face using camera and Python</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TN0Aw44zsLsuz_PA" /><figcaption>Photo by <a href="https://unsplash.com/@blavon?utm_source=medium&amp;utm_medium=referral">S&amp;B Vonlanthen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, developers!</p><p>Today, in this brief story, I want to share with you another little project in Python. Before to dive in with the description of the project I suggest you to read all the articles about Python that I wrote in the list <a href="https://medium.com/@girolamopinto1/list/pywithme-b076a3173eb7">Py with me</a> on my <a href="https://medium.com/u/504c7870fdb6">Medium</a> <a href="https://medium.com/@girolamopinto1">profile</a>, espacially if you aren’t good enough with Python.</p><p>Are you ready to follow me in this beautiful journey? Let’s go!</p><p>Note: don’t forget to see the <strong>final result</strong> at the end of the article.</p><h3>Intoduction</h3><p>Today I want to share the Emotion detection using Python, a very funny projects that allows you to become more skilled in python.</p><p>Remember to follow me on my other social media, in this way you’ll be updated every time I publish something new about Python. Below you’ll find a list of my other social media.</p><p>Let’s start!</p><p>This project it was made completely in Python and it’s basically a script which allows user to open the pc camera to detect the face and through an .xml file the script is able to recognize which emotion is on your face.</p><p>The .xml file we will using it&#39;s haarcascade_frontalface_default.xml and you can find it attached in this <a href="https://medium.com/u/8df3bf3c40ae">GitHub</a> <a href="https://github.com/girpinto/Emotion_Detection_Python">repository</a>. It&#39;s one of the haarcascades data file that you can use with <em>cv2</em> package.</p><p>The project was made by using <strong>PyCharm </strong>as IDE, but you can use whatever IDE you prefere or also the terminal. You can download PyCharm at this <a href="https://www.jetbrains.com/pycharm/download/#section=windows">link</a>. It’s important to understand that if you want to run this project you should install cv2 package, it doesn’t matter if you install it in PyCharm or directly in your machine.</p><h3>Packages needed</h3><p>Since the project use two different packages. it’s crucial that you install them, otherwise the code won’t run.</p><p>The packages imported in this project are: <strong>OpenCV </strong>and <strong>deepface</strong>.</p><h4>OpenCV package</h4><p>OpenCV is the huge open-source library for<strong> computer vision</strong>, <strong>machine learning</strong>, and <strong>image processing </strong>and now it plays a major role in real-time operation which is very important in today’s systems.</p><p>In the project you’ll see that I wrote import cv2, well for those who are not experienced in Python, OpenCV-Python is the library of Python bindings designed <strong>to solve computer vision problems</strong> and cv2 (<strong>old interface </strong>in old OpenCV versions was named as cv ) is the name that OpenCV developers chose when they created the binding generators.</p><h4>DeepFace package</h4><p>DeepFace is a deep learning facial recognition system created by a research group at Facebook. <strong>It identifies human faces in digital images</strong>. The program employs a nine-layer neural network with over 120 million connection weights and was trained on four million images uploaded by Facebook users.</p><h4>Packages installation</h4><p>In order to install these packages in our project, follow these steps:</p><ol><li>Go to Python packages tab</li><li>A panel with a search box will appear, type in the search box <em>opencv</em> and click the <em>Install</em> button on the right of the panel</li><li>Wait for the installation</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J841QulIHU4PVWzdw4XFHQ.png" /></figure><p>4. Then in the same search box type <em>deepface</em> and install it in the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3PxWcCEWNjhkP99D4FfGg.png" /></figure><p>Once you’ve done you can easily run the code.</p><h3>Brief description of components</h3><p>The project run the camera of your machine in order to recognize your face and detect the emotion. It’s pretty accurate. It creates a square around your face and put a text where there’s the emotion detected.</p><p>In order to create the square I used the cv2.rectangle() method from OpenCV in this way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smCOH9dEu2oXyyTHDJgGHA.png" /></figure><p>cv2.rectangle() method is used to draw a rectangle on any image.</p><ul><li><strong>Syntax</strong>: <em>cv2.rectangle(image, start_point, end_point, color, thickness)</em></li><li><strong>Parameters</strong>:<br>– <strong><em>image</em></strong>: It is the image on which rectangle is to be drawn.<br>– <strong><em>start_point</em></strong>: It is the starting coordinates of rectangle. The coordinates are represented as tuples of two values i.e. (X coordinate value, Y coordinate value).<br>– <strong><em>end_point</em></strong>: It is the ending coordinates of rectangle. The coordinates are represented as tuples of two values i.e. (X coordinate value, Y coordinate value).<br>– <strong><em>color</em></strong>: It is the color of border line of rectangle to be drawn. For BGR, we pass a tuple. eg: (255, 0, 0) for blue color.<br>– <strong><em>thickness</em></strong>: It is the thickness of the rectangle border line in px. Thickness of -1 px will fill the rectangle shape by the specified color.</li><li><strong>Return value</strong>: It returns an image.</li></ul><p>The OpenCV package provides a training method (see <a href="https://docs.opencv.org/3.4/dc/d88/tutorial_traincascade.html"><strong>Cascade Classifier Training</strong></a>) or pretrained models, that can be read using the cv::CascadeClassifier::load method.</p><p>In this project I used it so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jh637VRx7EGrC1uqUcYP5Q.png" /></figure><p><em>haarcascade_frontalface_default.xml</em> : <strong>Detects faces</strong>.</p><p>There are a lot of trained models that you can add to your project to make it more accurate. See this <a href="https://github.com/opencv/opencv/tree/master/data/haarcascades">link</a>.</p><p>To analyze the emotion detected on the face the script was made by using a <strong>try-except</strong> block, in order to launch an exception whenever the video opening fails:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcCOjba59YpiVLnXBarLnA.png" /></figure><p>Last but not least, remember to release the video and destroy all the windows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*YEuf3WZjTNsOe1U8e41gWA.png" /></figure><p>This will improve a lot the output of your code.</p><p>Below I’ll put the complete code, now let’s see the final result.</p><h3>Final result</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*ArrZFCqDi3DMJRwK6SgYOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*L4BChJoOdoCl04zh49ilpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*U7HA0KB7GMr7pDjbfOcWmA.png" /></figure><p>Not too bad in my honest opinion. 🤣🤣🤣🤣</p><p><strong>Note</strong>: To quit and to stop the script press ‘<strong>q</strong>’</p><p>Thanks for reading!! 🎉🎉🎉</p><h3>Complete Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgx102Y5cgAxsKDUPaG46g.png" /></figure><h3>References</h3><ul><li><a href="https://www.geeksforgeeks.org/"><strong>GeeksForGeeks</strong></a></li><li><a href="https://pypi.org/project/opencv-python/"><strong>Pypi.org</strong></a></li><li><a href="https://datatofish.com/upgrade-pip/"><strong>DataToFish</strong></a></li><li><a href="https://docs.opencv.org/3.4/db/d28/tutorial_cascade_classifier.html"><strong>OpenCV documentation</strong></a></li><li><a href="https://github.com/girpinto/Emotion_Detection_Python#run-the-code"><strong>GitHub Repository</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8642fade50a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drawing a heart in Python]]></title>
            <link>https://girolamopinto1.medium.com/drawing-a-heart-in-python-aab99e32fedf?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab99e32fedf</guid>
            <category><![CDATA[heart]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[turtle-graphics]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Sat, 11 Jun 2022 08:32:25 GMT</pubDate>
            <atom:updated>2022-06-11T08:32:25.813Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to draw a heart in Python using Turtle framework</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NUiSgEEv1RnEWDaJ" /><figcaption>Photo by <a href="https://unsplash.com/@nicolafioravanti?utm_source=medium&amp;utm_medium=referral">Nicola Fioravanti</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow developers! 💻</p><p>Here in this brief story, I want to share you a little project that could help you to love Python as I do. This isn’t a tutorial for beginners or advanced developers, this is just a project for everyone.</p><p>If you want the source code you can find it on Git-Hub at this <a href="https://github.com/girpinto/draw-heart-in-python">link</a>.</p><p>As always, if you haven’t signed up yet to my <a href="https://medium.com/u/504c7870fdb6">Medium</a> profile, well it’s time to do it. In this profile I love to share with you all my love for coding and programming and maybe you can find something useful here.</p><p>If you are interested only about how I drawn the heart you can go to directly to the <a href="#c2e4"><strong>Draw a heart project</strong></a> section.</p><p>Now it’s time for this brief story, good reading! 😜</p><h3>Turtle Graphics Framework</h3><p>Accordingly to Python’s documentation :</p><blockquote>Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967.</blockquote><p>Indeed, thanks to Turtle Graphics and obviously to Turtle module, programmers can create beautiful shapes ny simply using its methods. It’s a very fascinating way to approach to Python and to computer programming in general.</p><p>Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an import turtle, give it the command turtle.forward(15), and it moves (on-screen!) 15 pixels in the direction it is facing, drawing a line as it moves. Give it the command turtle.right(25), and it rotates in-place 25 degrees clockwise.</p><p>By combining together these and similar commands, intricate shapes and pictures can easily be drawn.</p><p><strong>The turtle module is an extended reimplementation of the same-named module from the Python standard distribution up to version Python 2.5. It tries to keep the merits of the old turtle module and to be (nearly) 100% compatible with it.</strong></p><h4>Framework overview</h4><p>The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support.</p><p>The object-oriented interface uses essentially two+two classes:</p><ol><li>The TurtleScreen class defines graphics windows as a playground for the drawing turtles. Its constructor needs a tkinter.Canvas or a ScrolledCanvas as argument. It should be used when turtle is used as part of some application. The function Screen() returns a singleton object of a TurtleScreen subclass. This function should be used when turtle is used as a standalone tool for doing graphics. As a singleton object, inheriting from its class is not possible. All methods of TurtleScreen/Screen also exist as functions, i.e. as part of the procedure-oriented interface.</li><li>RawTurtle (alias: RawPen) defines Turtle objects which draw on a TurtleScreen. Its constructor needs a Canvas, ScrolledCanvas or TurtleScreen as argument, so the RawTurtle objects know where to draw. Derived from RawTurtle is the subclass Turtle (alias: Pen), which draws on “the” Screen instance which is automatically created, if not already present. All methods of RawTurtle/Turtle also exist as functions, i.e. part of the procedure-oriented interface.</li></ol><p>The procedural interface provides functions which are derived from the methods of the classes Screen and Turtle. They have the same names as the corresponding methods. A screen object is automatically created whenever a function derived from a Screen method is called. An (unnamed) turtle object is automatically created whenever any of the functions derived from a Turtle method is called.</p><p><strong>To use multiple turtles on a screen one has to use the object-oriented interface.</strong></p><h4>Drawing using Turtle</h4><p>To make use of the turtle methods and functionalities, we need to import turtle.”turtle” comes packed with the standard Python package and need not be installed externally. The roadmap for executing a turtle program follows 4 steps:</p><ol><li>Import the turtle module</li><li>Create a turtle to control</li><li>Draw around using the turtle methods</li><li>Run turtle.done()</li></ol><p>So as stated above, before we can use turtle, we need to import it. We import it as :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*8HtOTe09fV5c4ZV2C5XvTw.png" /></figure><p>After importing the turtle library and making all the turtle functionalities available to us, we need to create a new drawing board (window) and a turtle. Let’s call the window as window and the turtle as my_turtle (because we have a lot of fantasy). So we code as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16Qet1iKQe_3LslTo6ix7Q.png" /></figure><p>Now that we have created the window and the turtle, we need to move the turtle. To move forward 100 pixels in the direction my_turtle is facing, we code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*OGi9uCUQXB_fdmzInuC9jQ.png" /></figure><p>We have moved my_turtle 100 pixels forward, Awesome! Now we complete the program with the done() function and We’re done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*MWdC7AAItEuvlSUz3-GilQ.png" /></figure><p>So, we have created a program that draws a line 100 pixels long. We can draw various shapes and fill different colors using turtle methods. There’s plethora of functions and programs to be coded using the turtle library in python.</p><h3>Draw a heart project</h3><p>The project is very easy and very fun to do on your own. It allows you to use a lot of methods from Turtle framwork. There is just one functions that I wrote to effectivly draw the heart on the screen. For the rest, they are all within the framework.</p><p>In pratice: the project draw a heart on a black screen and coloring in pink the heart itself.</p><p>The reasoning behind the project is very basic. Since the heart is a <em>simmetric shape</em> I’ve decided to split the code in two parts each one divided by the draw() function. In this way I can do the same exact thing, that I&#39;ve done on the left, on the right.</p><h4>The code</h4><p>After importing the turtle framework, I’ve started to give some informations about the speed of drawing, the background color and the size of the mark on the board:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_t7vUwtmcPf36E8Wg_LJg.png" /></figure><p>Then I created my loop to give instructions to the turtle pen about where to go and embedded all in function called draw()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMjf1NwCpxZ91gZB2L6Glg.png" /></figure><p>In the end I set the color of the pen and the color of the shape</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbJxcEtUdkovYG7pdJyG8w.png" /></figure><p>After all of this I’ve just put together all the turtle’s methods that suited best for my homework</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oC-SVY6H1sgmhoTR1-USuA.png" /></figure><p><strong>Note</strong>: As you can notice the draw() function is written two times, this because the heart that I drawn is a symmetric shape and you can do the same thing on both side, the left side and the right side.</p><p>Thanks for reading. 🥳🥳🥳</p><h3>Complete code</h3><p>Here the complete code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YakpzZKv_9DkttEvRP6gWg.png" /></figure><h3>References</h3><ul><li><a href="https://docs.python.org/3/library/turtle.html">Python Documentation</a></li><li><a href="https://www.geeksforgeeks.org/turtle-programming-python/">GeeksForGeeks</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab99e32fedf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loops and if-statements in Python]]></title>
            <link>https://girolamopinto1.medium.com/loops-and-if-statements-in-python-f13b80e73513?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f13b80e73513</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Wed, 08 Jun 2022 14:00:40 GMT</pubDate>
            <atom:updated>2022-06-08T14:00:40.819Z</atom:updated>
            <content:encoded><![CDATA[<h4>A in depth study about if-statements and loops in Python</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TVVVhAcx4KpvAXr3" /><figcaption>Photo by <a href="https://unsplash.com/@altumcode?utm_source=medium&amp;utm_medium=referral">AltumCode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow developers!🎉🎉</p><p>Here another beginners guide about statement and loops in Python, to proceed our in-depth learning of this beautiful programming language.</p><p>As always, there is an entire list about Python that I created here on <a href="https://medium.com/u/504c7870fdb6">Medium</a> called <a href="https://medium.com/@girolamopinto1/list/py-with-me-b076a3173eb7"><strong>PyWithMe</strong></a>. Come to take a look if you want to discuss about Python, you won’t regret it.</p><h3>Statements</h3><p>In computer programming, a statement is <strong>a syntactic unit of an imperative programming language that expresses some action to be carried out</strong>. A program written in such a language is formed by a sequence of one or more statements. A statement may have internal components, also called expressions.</p><p>So, a statement is a command that the programmer gives to the computer. For example: print(&quot;Hello, world!&quot;). This command has a <strong>verb </strong>(“print”) and other <strong>details </strong>(what to print on the screen).</p><p>In this section we will analyze a particular statement: the <strong>if-statement</strong>, also called <strong>conditional</strong>.</p><h4>If-statement (Conditionals)</h4><p>In computer science, <strong>conditionals</strong> are commands for handling decisions. Specifically, conditionals perform different computations or actions depending on whether a programmer-defined boolean <em>condition</em> evaluates to true or false. In terms of control flow, the decision is always achieved by selectively altering the control flow based on some condition (apart from the case of branch predication).</p><p><strong>Note</strong>: In computer science, the <strong>Boolean</strong> (sometimes shortened to <strong>Bool</strong>) is a data type that has one of two possible values (usually denoted <em>true</em> and <em>false</em>) which is intended to represent the two truth values of logic and Boolean algebra.</p><p>👉<a href="https://plato.stanford.edu/entries/boolalg-math/"><em>Here is a useful link if you want to know more about Boolean algebra</em></a>.</p><p>To accomplish the goal of making decisions, the terminology that Python uses to create conditionals statements, in pseudocode, is this:</p><figure><img alt="Pseudocode of if statement" src="https://cdn-images-1.medium.com/max/1024/1*WzA37B6QnO-sl2B0Y4zzlg.png" /></figure><p>This particular block of code tells a lot of things. First it tells us that just one block will be executed, the <em>if </em>one will be executed if the condition that we created results to be <strong>true</strong>. On the other hand, the <em>else </em>block will be executed<strong> if and only if</strong> that particular condition results to be<strong> false</strong>.</p><p>This is how we can tell to the compiler to take a decision. Now, let’s see an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*ltvHNWkScW2GdIuh1vqu8g.png" /></figure><p>In this example we asked to the compiler to print on the screen a sentence and to decide which sentence to print, based on the value of x.</p><h4>More than two options</h4><p>In the example above we just showed two possible options:</p><pre>if (condition is True):<br>  #Then do something....<br>else:<br>  #Do something else....</pre><p>Well, you have to consider that life is not that simple and more often we should say to our compiler to decide within a bunch of other options.</p><p>Lazy people could use just <em>if statements</em> to switch between options, for example:</p><pre>x = 10<br>if (x &gt; 5):<br>   print(&quot;x is greater than 5&quot;)<br>if (x &gt; 7):<br>   print(&quot;x is greater than 7&quot;)<br>if (x &lt; 12):<br>   print(&quot;x is smaller than 12&quot;)<br>if (x &gt; 9):<br>   print(&quot;x is greater than 9&quot;)</pre><p>Can you wonder what’s the result of these blocks of code?</p><p>Exactly! All of them!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*ytQ4RNpMsUIdfPkfjPjNTw.png" /><figcaption>I used Jupyter Notebook for this particular case, because I’m too lazy to open the Cmd Prompt</figcaption></figure><p>This happens because we didn’t say to the compiler to exclude some of these statements. But what happen if we want just one of them, excluding all the others?</p><p>In this particular case we can use<strong> elif statements</strong><em>, </em>that stands for <em>else-if.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*YDWDSFKOd8_mAgOVd-fO0w.png" /></figure><p>As you can see the result is just the first one, the compiler excludes by himself the other ones and this thanks to <strong>elif </strong>keyword.</p><h4>Nested if and else statements</h4><p>Sometimes could happen that we need more <em>if and else statements</em>, in this particular case we can talk about: <strong>nested statements</strong>.</p><p>I think that an example could give us more understanding about this topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*oU3oCX-ea2ne-V9Ybnfo-Q.png" /></figure><p>As you can notice, this particular blocks of code are called nested because each block is inside another block, like birds’ nests.</p><p>In our case we asked to the compiler to found the right value of <strong>x</strong>, the compiler goes through every nested statement and in the end it founds the correct one.</p><p>Obviously this isn’t <em>“well coding”</em>, because there are too many options, but it’s very useful to understand this topic. Remember that nested <strong>if and else statements</strong> could be long as you want, <strong>but shorter is better</strong>.</p><h3>Loops Statements</h3><p>In Python, a loop is a statement that contains instructions that continually repeats until a certain condition is reached.</p><p>Loops help us remove the redundancy of code when a task has to be repeated several times. With the use of loops, we can cut short those hundred lines of code to a few. Suppose you want to print the text <em>Hello, World!</em> 10 times. Rather than writing a print statement 10 times, you can make use of loops by indicating the number of repetitions needed.</p><p>But before to dive in the various examples, you have to know that there are three main types of loops in Python:</p><ol><li>For loops</li><li>While loops</li><li>Nested loops</li></ol><h4>For loops</h4><p>A for loop is used to iterate over a sequence like lists, type, dictionaries, sets, or even strings.</p><p>Loop statements will be executed for each item of the sequence. In our example we will use the function range()<strong>. </strong>The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number.</p><p>So, if we want to print ten times the words “Hello, World!” like we said before, how could we write that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*wjsDojR7a3ePb3p5th9ncQ.png" /></figure><p>Easy, don’t you?</p><p><strong>Note</strong>: The <strong>range()</strong> function starts from 0 (zero) and it increments by 1 each repetition. So you should count in this way: 0, 1, 2, 3,…., 9, that are ten times.</p><h4>While loops</h4><p>While loops are a bit more complicated. It continually executes the code as long as the given condition is <strong>TRUE</strong>. It first checks the condition and then jumps into the instructions.</p><p>For example, we want to print on the screen a sentence 5 times using a while loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*iStN3crmh97kYPHz-I77Rg.png" /></figure><p>As you can see, the while loop checks the condition, if it’s True then continues the flow and print the message, then add 1 to the original value of <strong>x</strong>. When the x reach the value 10, the while loop checks for the condition that returns False, at that point it stops the flow.</p><h4>Nested loops</h4><p>Nested loops mean using a loop inside another loop. We can use any type of loop inside any type of loop. We can use a while loop inside for loop, a for loop inside a while loop, a while loop inside a while loop, or a for loop inside a for loop. Fantasy is our ally.</p><p>Let’s try to make an example. We want to print on the screen all the even numbers between 1 and 10 included.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*o7pAP-tev3zL579WCaU6hQ.png" /></figure><p>In this example we used a <em>for loop</em> to count from 1 to 10 included and a<em> while loop </em>to check if the number in the sequence is even or not using the<em> </em><strong>operator % (modulus)</strong>. Basically with the modulus operator (%) we’re trying to ask to the compiler to check if the remainder by dividing the number by two is zero. After checking if the parity condition is satisfied, we print the message {number} is an even number, where {number} is replaced with the effective number by the format() function that we saw in <a href="https://girolamopinto1.medium.com/formatting-in-python-dff14824bf0f">this article</a> about strings and formatting.</p><p>And this is it for now about if and else statements and loops in Python. I hope that you enjoyed the article and that you found it useful.</p><p>Don’t forget to save this list about Python and to follow me for further updates about beginners tutorial in Python. See ya!! 🥂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f13b80e73513" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Formatting in Python]]></title>
            <link>https://girolamopinto1.medium.com/formatting-in-python-dff14824bf0f?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/dff14824bf0f</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Fri, 08 Apr 2022 21:11:56 GMT</pubDate>
            <atom:updated>2022-04-08T21:11:56.897Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to format string in Python and link values to them</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-liKg7lUxTmnO_c" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=medium&amp;utm_medium=referral">Mohammad Rahmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow developers.</p><p>Here we are with another beginners guide about Python. In this guide we’re going to present some ways to format string in Python and to link our variables to them. In this way we can display on the screen all the informations we need in just one string.</p><p>There are many ways to put all the informations in one string. Today we will see four methods and you could choose your favourite method.</p><h3>Typecasting</h3><p>The first method I propose to you is the <strong>casting </strong>method. Don’t worry, you shouldn’t perform a piece on a stage.</p><blockquote>Casting is when you convert a variable value from one type to another. That is, in Python, done with functions like int() or float() or str(). A pattern is that you convert a number as a string into a number.</blockquote><p>The practice of converting the value of a single data type (integer, string, float, etc.) to a different data type is known as type conversion. Python includes two types of type conversion:</p><ul><li>Explicit Conversion</li><li>Implicit Conversion</li></ul><h4>Explicit Conversion</h4><p>In Explicit Type Conversion, users <strong>convert the data type of the item to needed data type</strong>. We use the predefined roles such as int(), float(), str(), etc to execute explicit type conversion.</p><p>This type of conversion is also called typecasting because the user casts (change) the data type of the objects.</p><p>Let’s make an example. As you know we can <em>concatenate</em> strings and put them together by using the <strong>+ (plus) </strong>operator. But if we try to concatenate other types of values, we’ll get an error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeIsBIGF9itAPDrQcg91bA.png" /></figure><p>As you can see an exception raised telling us that we <strong>can only concatenate strings values</strong>. In our help it comes the <strong>typecasting</strong>, or simpler <strong>casting</strong>. What we’re going to do, is to convert all these values, integers and floats, in string values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2D37wk-T9uFSc_TrnmwdoA.png" /></figure><p>As you can see, we converted our integer and float values in strings. Obviously we don’t need to convert the variable dog_name because it’s a string value already.</p><p>So the str() operator can help us to show all the informations we need in just one string, without converting by hand the values written before. We can do this process also with other <strong>data types</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8O51ONSVckrARfqrc5-4g.png" /></figure><h4>Implicit Conversion</h4><p>In implicit conversion, Python automatically <strong>converts one data type to another data type</strong>. This process doesn’t need any user involvement. To be honest, this type of conversion is useless for what we’re talking in this guide, but it’s a good thing knowing about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ip0rE0w7TyGpZHVM6uLcpw.png" /></figure><p>As you can notice, from the code above, we created two variables num_int and num_float, respectively an integer value and a float value, preserving their sum in another variable num_new.</p><p>From the output, we may observe the datatype of num_int is an integer, the datatype of num_float is a float thanks to type() method.</p><p>Additionally, we may observe the num_new has float data type as Python consistently <strong>transforms smaller data type to bigger data type to prevent the lack of data</strong>.</p><h3>Old school Formatting</h3><p>I call this method an <em>old school method</em>, because it’s a C-like method and for those who are experienced with C-like programming languages, it could sound very familiar.</p><p>Python uses C-style string formatting to create new, formatted strings. The <strong>%</strong> operator is used to format a set of variables enclosed in a <strong>tuple </strong>(a fixed size list), together with a format string, which contains normal text together with <strong>argument specifiers</strong>, special symbols like %s and %d.</p><p>Let’s take the example above to try ourselves this new method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5kRiV7LnE5HeMtVxgdYwDA.png" /></figure><p>As you can see we reduced a lot the code written and we didn’t use the casting to tell Python the type of data of each value. This is very useful when we have a lot of data stored and we don’t want to make a casting on these data.</p><p><strong>Note </strong>: the symbol <strong>%.2f </strong>it represents the float value, the dot and the number represent the number of digits we want after the comma; by default there are six digits.</p><h3>New school Formatting</h3><p>Python offers to developers another way to link strings and other data types, a modern way. By using the format() method. In this way we can better specify what kind of values we link to the string and we don’t need to remember any kind of symbols, but we just need to type the value.</p><p>Let’s make an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qo3xXjSvTaw10pNV_egAZw.png" /></figure><p>As you can see we used curly brackets to interpolate the value we expect and in format() method we associated that value with the corresponding variable.</p><p><strong>Note </strong>: in curly brackets we can use the name we want for the value.</p><h3>Formatting in Python 3.6 and above</h3><p>This is my preferred method, because it’s easy and fast but, rather than the <strong>new school method,</strong> here we should necessarily use the name of the variables we stored.</p><p>Let’s try it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G9Slj6VabJz8RWa-mTF8dg.png" /></figure><p>As you can notice we just need to put a f character before quotation marks to tell the compiler that we’re formatting the string and inside the curly brackets we use the same name that we used to store variables before.</p><p>🖐<em>Well, that’s all for this beginners guide. I hope that you found this guide useful.</em></p><p>✍<em>For any further clarification, write down in the comments section, I’ll be glad to answer you.</em></p><p>🍕<em>Follow me on my socials: </em><a href="https://www.instagram.com/girolamopinto/"><em>instagram</em></a><em>, </em><a href="https://www.facebook.com/girolamo.pinto"><em>facebook</em></a><em>, </em><a href="https://www.linkedin.com/in/girolamo-pinto-250b89164/"><em>linkedin </em></a><em>and </em><a href="https://github.com/girpinto"><em>github</em></a><em>.</em></p><p>📧<em>Mail me at: </em><a href="/service/mailto:girolamopinto1@gmail.com"><em>girolamopinto1@gmail.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dff14824bf0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling errors in Python]]></title>
            <link>https://girolamopinto1.medium.com/handling-errors-in-python-209f03cb6751?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/209f03cb6751</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python-developers]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Tue, 29 Mar 2022 12:32:45 GMT</pubDate>
            <atom:updated>2022-03-29T12:32:45.369Z</atom:updated>
            <content:encoded><![CDATA[<h4>Master “try / except” block</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qLXVa2ppzT748tmj" /><figcaption>Photo by <a href="https://unsplash.com/@altumcode?utm_source=medium&amp;utm_medium=referral">AltumCode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow developers!</p><p>Today, in this guide, I want to help you to master <strong>errors handling in Python</strong>. We will discover how to manage errors made by users and how to avoid a crash system. I want to remember you that there is a list about Python and if you have no experience at all with it, I suggest you to read all those guides to understand better what we will explain here.</p><p><a href="https://medium.com/@girolamopinto1/list/py-with-me-b076a3173eb7">Link to the list</a>. <br><a href="https://girolamopinto1.medium.com/input-and-output-in-python-ad3c456c4e2c?source=friends_link&amp;sk=65a55c04163359292337835820e2f8eb">Link to the last guide on Python about input/output and data types</a>.</p><p>Without futher explanations let’s go catch these errors!</p><h3><strong>Managing errors</strong></h3><p>Since the computers born and computer programming with them, there was always the desire to automate and simplify the human processes. But, since the human is an imperfect machine, sometimes computer programmers should try to understand human behavior to avoid making errors or to prevent them.</p><p>In order to do so, at the beginning of computer programming, the choice for humans was so limited, because computer programmers couldn’t predict all the humans behaviors.</p><p>Programming languages came in help by creating an elegant and simple solution, giving to computer programmers and developers new methods to predict and to manage errors made by humans or by the computer itself. And most of all the<strong> OOP (Object Oriented Programming)</strong>, gave to developers the opportunity to manage many human behaviors without losing perfomances or without giving to humans a limited choice when they use their code.</p><p>In this guide we will look at one these methods in <strong>Python</strong>: the <strong>try / except</strong> block. But before to go in deep let’s understand what is an error.</p><h4>What is an error?</h4><p>In computer programming, <strong>errors </strong>are also called <strong>exceptions</strong>. As you can read on <a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/definition.html"><strong>Oracle Java Documentation</strong></a>:</p><blockquote>The term <em>exception</em> is shorthand for the phrase “exceptional event.”</blockquote><blockquote><strong>Definition:</strong> An <em>exception</em> is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s instructions.</blockquote><blockquote>When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an <em>exception object</em>, contains information about the error, including its type and the state of the program when the error occurred. Creating an exception object and handing it to the runtime system is called <em>throwing an exception</em>.</blockquote><blockquote>After a method throws an exception, the runtime system attempts to find something to handle it. The set of possible “somethings” to handle the exception is the ordered list of methods that had been called to get to the method where the error occurred.</blockquote><p>It’s important to remember that a <em>method </em>it’s how programmers call functions in programming languages. A function, or a method as well, do something useful for the code. Inside a method you write a block of code and after calling that method the compiler execute that code.</p><p><em>Throwing an exception</em> it’s the slang used when an error handling is raised by programmers to litterally catch the error before the system goes in crash. In other programming language this particular block of code is called <strong>try /catch</strong> block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*YTQaO2FR7Toh40U58Naktg.jpeg" /></figure><p>But how it works?</p><h4>Let’s “try” a block of code…</h4><p>When you don’t know if a particular block of code will raise an error, maybe made by the human who uses the code or maybe made by the compiler or the computer itself, it’s a good behavior to put that particular block of code in a <strong>try </strong>block. Just like says the word we try a particular code and if it works we’re so happyand we go out to party, but if it doesn’t work we shouldn’t fall in tunnel of despair and try to handle the error preventing the crash of the system.</p><p>The try block it’s made for this kind of situation, when you don’t know if the block that you’re going to execute will work or not. Obviously the try block should be matched with another block, that in Python it’s called: <strong>except</strong>.</p><h4>… “except” something extraordinary happens</h4><p>The except block lets you handle the error. Since the try block raises an error, the except block will be executed. Without the try block, the program will crash and raise an error.</p><p>For example let’s try to raise an error in Python. Open Command Prompt in Windows by typing on your keyboard windows button and then typing in the Search bar <em>Command Prompt.</em></p><p>Once in Command Prompt let’s type python and press <strong>Enter</strong>. It should be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKiDhEswhuFTRzREpLizsw.png" /></figure><p>Now let’s write some code, for example print(x).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFlXoqkW-cNeXLMOSz2Ljw.png" /></figure><p>As you can see the code <strong>raised an error</strong> as we expected, specifically the code raised a <strong>NameError</strong>, which it means that you forgot to declare a variable or you wrote a wrong name for the variable that should be used by the code.</p><p>Obviously we know how to handle this error, we need just to declare the x variable and we’ve done. But in many other cases, it won’t be so easy.</p><p>Now let’s try to include this code in a try except block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4D7x54D8p6f2gvjDK8Ts0g.png" /></figure><p>As you can see we put the code that generates an error in a <em>try</em> block and we catch the error with the <em>except </em>block. In the except block we put a print() which handle the error printing a message on the screen without raising an error and avoiding the system crash.</p><p><strong>Note</strong>: Remember that in Python the indentation is really important if we don’t use the indentation the code will still generate an error.</p><p>You can define as many exception blocks as you want, e.g. if you want to execute a special block of code for a special kind of error. If you look at the error we raised intentionally you can easily check that is a <strong>NameError</strong>, we will use it to make our example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auhP6Ic2fd3KfqKHeOdRQQ.png" /></figure><p>As you can see the first except handled the error but the second won’t be executed, this happens because we specified the error that we want to handle and since the only error which will be thrown is the <strong>NameError</strong>.</p><h4><strong>“Else” continue the flow</strong></h4><p>And if there are no errors raised?</p><p>Sometimes could happen that our code doesn’t raise any error, maybe we were lucky or maybe we wrote a good code. But how can you continue the flow of your code without stopping the process? In our help we have the else keyword that tells to the compiler to continue to processing the code without raising an exception. Let’s see an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ZzRntlsKo_aFLeNIMZYvw.png" /></figure><p>As you can see the code in the try block didn’t raise any exception, this means that the program can continue its flow, to say that we use the else keyword. The code in except block won’t be executed, because there are no errors raised by the code in the try block.</p><h4>“Finally” it works</h4><p>Sometimes we need to proceeed with the flow of the program regardless of whether an exception was thrown or not. For example if you are running a software and an error raises the software still works and it doesn’t shut down. To do so we need the finally keyword. The finally block, if specified, will be executed regardless if the try except block raises an error or not. Let’s see it in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpl9xDfM9ahfrhzHxbvdcQ.png" /></figure><p>As you can see the code in finally block it was executed even if an error was raised in the try except block. The finally block it’s useful when we work with files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOJi3iqQWPNURuds8OnXiQ.png" /></figure><p>In this example we are trying to open an to write to a file that is not writable. Thanks to finally keyword the program can continue, without leaving the file object open.</p><h4>“Raise” your exceptions</h4><p>As a Python developer you can choose to throw an exception if a condition occurs.</p><p>To throw (or <em>raise</em>) an exception, use the raise keyword. This is very useful when you want particular behaviors in your program even if there are no specific errors raised by the compiler. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuwNxFGxCFPw18KvjM5CYQ.png" /></figure><p>As you can see in the if statement we raised our own exception by using the keyword raise and then we defined the excpetion using the Exception() method.</p><p>And obviously we can raise also some specific error. For example let’s try to raise a <strong>TypeError</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*I7VnN1epFPFGNWpGvaHxvg.png" /></figure><p>As you can see the error message appears like a <strong>TypeError </strong>message.</p><h3>Sum up</h3><p>To understand better what we learnt:</p><ul><li>The try block lets you test a block of code for errors.</li><li>The except block lets you handle the error.</li><li>The else block lets you execute code when there is no error.</li><li>The finally block lets you execute code, regardless of the result of the try except blocks.</li><li>The raise keyword is used to raise your own exception.</li></ul><p>I hope that you found this guide useful and interesting. For any further questions don’t hesitate to comment below, I’ll be glad to answer to your questions.</p><p>If you want you can follow me on my other social media:</p><figure><a href="https://github.com/girpinto"><img alt="" src="https://cdn-images-1.medium.com/max/42/1*QSF1QocOnGxJl-8b5MghnA.png" /></a></figure><figure><a href="https://www.instagram.com/girolamopinto/"><img alt="" src="https://cdn-images-1.medium.com/max/48/1*c68UMB7e4mXgeTOTk_De7Q.png" /></a></figure><figure><a href="https://www.facebook.com/girolamo.pinto/"><img alt="" src="https://cdn-images-1.medium.com/max/48/1*dLVwmVkdch9FSOLKeyG0iQ.png" /></a></figure><figure><a href="https://www.linkedin.com/in/girolamo-pinto-250b89164/"><img alt="" src="https://cdn-images-1.medium.com/max/48/1*HHaJSquMjHRLRbKkNfeEMA.png" /></a></figure><h3>References</h3><ul><li><a href="https://docs.oracle.com/javase/tutorial/essential/exceptions/definition.html">https://docs.oracle.com/javase/tutorial/essential/exceptions/definition.html</a></li><li><a href="https://www.w3schools.com/python/python_try_except.asp">https://www.w3schools.com/python/python_try_except.asp</a></li></ul><p><strong>Note</strong>: Icons taken on <a href="https://www.iconfinder.com/search?q=github">IconFinder website</a> with <a href="https://creativecommons.org/licenses/by/4.0/">Attribution 4.0 International (CC BY 4.0)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209f03cb6751" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Input and Output in Python]]></title>
            <link>https://girolamopinto1.medium.com/input-and-output-in-python-ad3c456c4e2c?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad3c456c4e2c</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 16:13:02 GMT</pubDate>
            <atom:updated>2022-03-17T16:13:02.113Z</atom:updated>
            <content:encoded><![CDATA[<h4>An overview on variables and data types</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UfNGBbwW_79wvX7v" /><figcaption>Photo by <a href="https://unsplash.com/@ffstop?utm_source=medium&amp;utm_medium=referral">Fotis Fotopoulos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow developers.</p><p>Today, in this article, I want to talk about <strong>input and output</strong> in Python, the main functions in Python to get some data and to print them on the screen.</p><p>As always I want just to remember that this guides are intended to be gradually more complex and if you want to start from the beginning (maybe because you have no experience in Python or in computer programming at all), you can check <a href="https://medium.com/@girolamopinto1/list/py-with-me-b076a3173eb7">the list the I’ve created about Python and all the related topics</a>.</p><p>Ok let’s jump into the article and let’s discover more about variables and data types.</p><h3>Variables</h3><p>In computer programming, a variable is <strong>an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of information referred to as a value</strong>; or in simpler terms, a variable is a container for a particular set of bits or type of data (like integer, float, String etc…)</p><h4>Data types</h4><p>Variables come in all shapes and sizes. Some are used to store numbers, some are used to store text and some are used for much more complicated types of <strong>data</strong>.</p><p>The <strong>data types</strong> to know are:</p><ul><li><strong>String</strong> (aka string): Used for a <strong>combination of any characters that appear on a keyboard</strong>, such as letters, numbers and symbols. It could be also just <strong>one character</strong>.</li><li><strong>Integer</strong> (aka int): Used for <strong>whole numbers</strong>.</li><li><strong>Float</strong> (aka float): Used for <strong>numbers that contain decimal points</strong>, or for <strong>fractions</strong>.</li><li><strong>Boolean</strong> (aka bool): Used where data is restricted to <strong>True/False</strong> or <strong>yes/no</strong> options.</li></ul><p><strong>Note </strong>: if you’re interested in the <strong>boolean logic</strong> you can check this <a href="https://computer.howstuffworks.com/boolean.htm">website</a>.</p><h4>Declare a variable and assigning it a value</h4><p>In computer programming, when someone say “declare a variable”, he means that you should create that particular variable.</p><p>In order to do that in Python, you should just type the name of the variable and you should assign it a value, in this way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghc_XX_CYGZZsGOMRH1Ouw.png" /></figure><p>As you can see <strong>declaration of a variable</strong> is really easy:</p><pre>name of the variable = value of the variable</pre><p>The = sign it doesn’t mean <em>it’s equal to, </em>but <em>assign the value on the right to the variable on the left.</em></p><p><strong>Note</strong> : the # sign that you see on the side it’s a coment, I’ll talk about it in the next section.</p><p>In many <strong>programming languages</strong> you should declare the data type of variables before they can be used, for example:</p><ul><li>Visual Basic — dim score as int</li><li>Java — int score;</li></ul><p>But in <strong>Python, you can simply start using the variable without declaring it.</strong></p><h4>Naming a variable</h4><p>A variable to be so should have a name. This particular string will store the data written on the right of the = sign. In the example above we had:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50dbUz5ee0IveDWpzlYLkw.png" /></figure><p>This example means that to the variable called name it’s assigned a string value &quot;Girolamo&quot;. The name given to each variable is up to the programmer, but ideally a variable name should have meaning, ie it should reflect the value that it is holding.</p><p>There are some rules about variable names:</p><ul><li><strong>Consistency</strong>: name is not the same as Name or NAME.</li><li><strong>Spacing</strong>: variable names should not have a space in them. Use <strong>underscores </strong>or <strong>camelCase</strong> instead, for example name_of_client or clientName. A variable name can also start with an underscore, for example _name or _name_of_the_client_.</li><li><strong>Digits</strong>: variable names should not start with a digit, but they can have digits between charcters.</li></ul><p>Consider these example variable names, all of which could be variable names to store the length of a side of a square:</p><pre>╔══════════════════╦═══════════════════════════════════╗<br>║  <strong>Variable name</strong>   ║              <strong>Comment  </strong>            ║<br>╠══════════════════╬═══════════════════════════════════╣<br>║ l                ║ A poor choice – it has no meaning ║ <br>║ length           ║ Okay but a bit vague              ║ <br>║ side_length      ║ Good                              ║ <br>║ sideLength       ║ Good                              ║<br>║ side length      ║ Wrong – don’t use spaces          ║ <br>╚══════════════════╩═══════════════════════════════════╝</pre><h4>Comments</h4><p>In computer programming, a comment is <strong>a programmer-readable explanation or annotation in the source code of a computer program</strong>. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.</p><p>For example, if I create a variable with a strange name, maybe I want to explain to whoever read the code, what the hell is that variable or to describe the behaviour of a function.</p><p>In Python to start a comment section, you should just type “#”, everything after “#” sign will be a comment. And the interpreter won’t compute it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55dIRZ_5syv7moRNOSDi8w.png" /></figure><h3>Input and output</h3><p>Now let’s try to use variables to input something typing it with keyboard and then let’s try to print what we wrote on the screen.</p><h4>Output with the print() function</h4><p>To print something on the screen we will use a function that we’ve seen in previous guides: the print() function.</p><p>The print() function it’s very powerful and in this particular case can print on the screen what we’ll give as input to Python.</p><p>To use the print() function you should just write print() (obviously) and inside the parentheses you put the text that should appear on the screen between single or double quotation marks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yq-bkIlR5CqKMLQlw_wjaA.png" /></figure><p><strong>Note</strong>: The last print that I wrote will lead to an <strong>Error</strong>.</p><h4>Input with the input() function</h4><p>In Python, we use <strong>input() function to take input from the user</strong>. Whatever you enter as input, the input function converts it into a string.</p><p><strong>Note</strong>: If you enter an integer value still input() function convert it into a string.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*nsnsbv_gK92ikpTclbm1GA.png" /></figure><p>As you can see I used the type() function, which allows to programmer to know which type is a variable. The type() function on x variable said what we expected: str which means string. But as I said before the input() function transforms everything in a string, so the y variable, the variable assigned to the age which should be an integer, becomes a string.</p><h4>Casting</h4><p>If we consider the example above, maybe we want to convert the y` variable in integer, in this way we shouldn’t treat it like a string variable. In our help, to solve this problem, it comes the <strong>casting</strong>.</p><p>Casting is <strong>when you convert a variable value from one type to another</strong>. That is, in Python, done with functions like int() or float() or str(). Let’s try it with the example above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*bckY95NFkAv7Fz-YRez_fA.png" /></figure><p>We did it! 🎉🎉🎉</p><h3>Let’s code</h3><p>Okay, now we put everything we learnt in action and we try to use all the basic functions to ask to our user (ourselves for now) to provide some informations and to print them on the screen.</p><h4>What we’ll do</h4><p>To achieve this part let’s write down what we’ll do in order to accomplish our desire.</p><ol><li>We will ask the name of the user</li><li>We will ask the age of the user</li><li>We will ask if he\she has interest in Python</li><li>And we will display an easy message depending on the answer to the above request</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lq0oM_H1yLL1aA_of-l3KQ.png" /></figure><p>Just the last thing. In the last four lines of command I used a casting on the answer variable, trasforming it in a boolean variable. And then I used an if statement to check if the answer was True and if so I asked to the interpreter to print a message. In every other cases the message wouldn’t appeared. Like in this case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*x7C9azzpJhEwr-3uIorwxA.png" /></figure><p>As you can see I didn’t receive any output message because the if statement will be executed only if the answer is equal to false.</p><p>Don’t worry if you still don’t understand something it’s totally normal. The next topic will be the if statement.</p><p>See ya!!</p><h3>References</h3><ul><li><a href="https://computer.howstuffworks.com/boolean.htm">https://computer.howstuffworks.com/boolean.htm</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad3c456c4e2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python — Your first script]]></title>
            <link>https://girolamopinto1.medium.com/python-your-first-script-6998f766b573?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6998f766b573</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Sat, 12 Mar 2022 11:00:09 GMT</pubDate>
            <atom:updated>2022-03-12T11:00:09.526Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python — Your first script</h3><h4>And a first look to PyCharm IDE</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*su8wRjGbhqnHWZ0e" /><figcaption>Photo by <a href="https://unsplash.com/@oskaryil?utm_source=medium&amp;utm_medium=referral">Oskar Yildiz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, fellow readers!</p><p>Today, for the <strong>Py with me</strong> rubric, I want to share with you a new story about our favourite programming language: Python. These stories obviously are intended for those who want to learn to code in Python, so basically for those who are beginners in this beautiful world. Gradually, when I’ll become more expert in this field, I’ll start sharing more complex projects.</p><p>Today we’ll see how to start coding in Python, we’ll see three methods and at the end of the guide you’ll be able to write <strong>you very own first script in Python.</strong></p><p>Are you excited?</p><p>Let’s start!</p><h3>First steps</h3><p>Before to go in deep in today’s topic, i suggest you to read, if you haven’t done it yet, this article of mine about <a href="https://girolamopinto1.medium.com/install-python-3-on-microsoft-windows-a2df9b48ef9f"><strong>installing Python 3 in Microsoft Windows</strong></a><strong>.</strong></p><p><strong>Note: </strong>take a look to the list that I’ve created about Python<strong>, </strong><a href="https://medium.com/@girolamopinto1/list/py-with-me-b076a3173eb7"><strong>Py with me</strong></a>, in this list I’ll share everything I know and everything I’ll learn about Python, so stay tuned.</p><p>Now, just a couple of things. You should know that you can code in Python in a lot of different way, you just have to choose one. My suggestion is always to download an IDE (Integrated Development Environment) and to start learning it. I’ll explain why in the following sections.</p><p>Here we are some examples on how to start coding in Python:</p><ol><li>Using the Terminal</li><li>Using a web interpreter</li><li>Using an IDE (Integrated Development Environment)</li></ol><p>In this article we will see these three ways to code in Python and to start learning about this particular programming language.</p><h4>Python in Terminal</h4><p>For those who aren’t so skilled in programming or nevere seen the Terminal, well Terminal is also known as command lines or consoles, <strong>allow us to accomplish and automate tasks on a computer without the use of a graphical user interface</strong>.</p><p>You can open up the Terminal by:</p><ol><li>Typing on your keyboard Windows button + “r”, then in the box that appears you should just type “cmd”, et voilà, your console is ready and you can write on it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F90xlIv9okgU_U0EARvkzg.png" /><figcaption>Where you see the white pen, there will be your name</figcaption></figure><p>Then you just have to type python<strong>` </strong>on the right of the sign<strong> </strong>&gt; and you can code in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GT0nC7drzpzCFx9JNmigXw.png" /></figure><p>From here we can start to code in Python whatever we want. For example we want to ask to Python to perform some calculations. To do that we can type the folowing code: <strong>print(10+10) </strong>and we can see the result above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wNmad3soWerJ8oOLtV6b1w.png" /><figcaption>The part in red box is our code</figcaption></figure><p>Yuuhuuu!! Congratulations, you’ve just typed your first code in Python! Are you excited about that?</p><p>To understand this, if you’re not familiar with other programming languages, we’ve just asked to Python to perform a simple calculation: <em>10 + 10</em>. As we expected the result was 20 and through the function print()<strong> </strong>we’ve just asked to Python to litterally “print” the result on the screen.</p><p>The print() function is very powerfull in Python language and in many other programming languages, maybe in another article I’ll explain better the potential of this particular function. For now just remember that print() it means : <em>I want to print this particular thing on the screen.</em></p><h4>Project Jupyter</h4><p>To start in an easy way, I suggest something that helped me so much while I was starting to learn Python: online IDE.</p><p>Exactly, you read that right! To code in Python you don’t need to install an IDE, you can code using an online IDE, like <a href="https://jupyter.org/try-jupyter/retro/notebooks/?path=notebooks/Intro.ipynb"><strong>Jupyter Notebook</strong></a><strong>.</strong></p><p><strong>Note</strong>: You can code by using your web browser, but this is suggested just for small scripts, not for a whole project.</p><p>As you can read on the official page of Project Jupyter:</p><blockquote>Project Jupyter builds tools, standards, and services for many different use cases.</blockquote><p>Indeed, Jupyter offers the possibility to create scripts in Python, C++, R, just using your web browser. This is possible thanks to Jupyter Notebook. To open it up just go on <a href="https://jupyter.org/">Project Jupyter website</a>, then scroll down to the button <em>Try it in your bowser.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgFdBzkpPciXZyoGDcQmYA.png" /></figure><p>Click on it and it should open another window where you just have to scroll down and click on <strong>Jupyter Notebook</strong>, that’s the one we use for coding in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxilBBQQOpG2GI7Li8TRnQ.png" /></figure><p>Once you’ve clicked on it, you will see the <strong>Intro</strong> for Jupyter Notebook, I suggest you to read this informations, they could be very useful.</p><p>But if you’re a lazy person like me, just skip all of these bunch of useful informations about how to use correctly Jupyter Notebook and follow these steps to start coding in Python:</p><ol><li>Click on <em>File</em> in the upper left corner</li><li>Move the cursor to <em>New </em>tab in the dropdown menu</li><li>Click on <em>Notebook</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*935hsrLLoSgA69KZOMzyAg.png" /></figure><p>It will open another tab in your browser, here you can see a small window that asks you to choose a kernel, just select the default one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odfJVY9rEgcnmZNj2gJ18g.png" /></figure><p><strong>Note</strong>: For those who doesn’t know what is a kernel, well the kernel is a computer program at the core of a computer’s operating system that has complete control over everything in the system. It is the <em>portion of the operating system code that is always resident in memory</em>, and facilitates interactions between hardware and software components. In our case we are using a notebook kernel. A notebook kernel is a “computational engine” that executes the code contained in a Notebook document. The <em>Pyolite </em>kernel, referenced here, executes python code.</p><p>Now we can type our code and start coding in Python, let’s try the example that we made before.</p><p><strong>Remember: </strong>to execute a portion of code in Jupyter Notebook we can’t just type <em>Enter</em> on our keyboard, we should press <em>Shift + Enter.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqJQfrtl1V0Da3idHL_3NA.png" /></figure><p>It works! Great!</p><p><strong>Note</strong>: Jupyter offers also the chance to download it and to use it directly on your machine without using the web browser.</p><h4>Python in IDE (PyCharm edition)</h4><p>The examples above can help us to write small chunks of code in Python, they aren’t useful for big project in Python. First because it’s harder to detect errors while writing the code and second, because we can’t create a lot of project files or using files in our local machine.</p><p>So, to accomplish our desire of coding big projects in Python, let’s try to install an IDE that will help us to be more efficient while writing Python code.</p><p>The <strong>IDE (Integrated Development Environment) </strong>that I chosen for this guide is: <strong>PyCharm</strong>. Since PyCharm is computer program we need to install it on our machine, so follow these easy steps to install it fast:</p><p><strong>Windows installation</strong></p><ol><li>Go to <a href="https://www.jetbrains.com/pycharm/download/#section=windows">JetBrains website</a></li><li>Click on <em>Download </em>button under <strong>PyCharm Community Edition</strong> tab</li><li>Wait for download…</li><li>Click on downloaded .exe file in your <em>Download </em>folder and install <em>PyCharm Community </em>on your machine</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2edVFK2mABhn43gPhUTTJA.png" /></figure><p>Click on PyCharm Community Edition icon and start the IDE.</p><p>Once you opened the program, click on <em>File</em>, in the upper left corner, then in the drop down menu click on <em>New Project…</em> . You’ll see this window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hmsZ3NLqrA1AYexOOamFpg.png" /></figure><p>As <em>Location </em>choose the location you prefer, in location part if you change the last part of the path you change also the name of the project, in my case I named the project <em>pythonProject1</em>. The <em>Virtualenv </em>is the virtual environment of <strong>PyCharm</strong>, it’s perfect for now. As <em>Base interpreter</em> choose the most updated version of Python, you can check it by looking at the path, in my case is <em>Python310</em>, that stands out for <strong>Python 3.10</strong> (at the time of writing Python 3.10 is the most recent version). Last, check the <em>Create a main.py welcome script</em> option. When you’ve done, the PyCharm window shoul look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpyt_IdtiEY9sQft-mFJkg.png" /></figure><p>Before to write our code, let’s take a look to PyCharm window</p><p>Now let’s write some code in PyCharm to start with our first script. We can use the example above to make sure that everything works fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OEMP3aROAG9oaeg3ZSQmQ.png" /></figure><p>It works! Great!</p><p>In the upcoming section you’ll write your very first script. Are you ready?</p><h3>First script in Python</h3><p>Before to start we should talk about Python programming language. Indeed, learning a new programming language it’s like learning a new language when you land in another country: in our case the country is our machine and the language which is used by this machine it’s called <em>machine language</em>. Our purpose is to communicate with this machine and Python programming language helps us by translating what we write in Python into machine language.</p><p>Basically a programming language is any set of rules that converts what we write in that specifically programming language, into machine language, to talk with the machine explaining it what we want.</p><p>But what are the rules of Python? Well, <strong>Python</strong> is a high-level, general-purpose programming language, this means that you can use it to do whatever you want. High-level, instead, it means that you can write in Python almost like you write in english.</p><h4>Syntax</h4><p>In linguistics, <strong>syntax</strong> is the study of how words and morphemes combine to form larger units such as phrases and sentences.</p><p>In programming languages syntax refers to <strong>the rules that define the structure of a language</strong>. Syntax in computer programming means the rules that control the structure of the symbols, punctuation, and words of a programming language.</p><p>In Python there’s an important rule that you shouldn’t understimate: <strong>indentation</strong>. Whenever you write your code remember to indent it, because if you don’t do that this will lead to an<em> IndentationError</em>.</p><p>This means that when you should write something like <em>“if number1 is greater than number2, then print number1 greater than number2”</em>, you should write:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qWvhLnLMRGysj9Xt_F8qg.png" /></figure><p>As you can see the print() function is more to the right than the if() statement. This is the <strong>indentation</strong>. You can do the indentation by pressing the <strong>space bar</strong> (4 spaces are enough) or by pressing the <strong>Tab </strong>(by default are 4 spaces).</p><p>If I write it without using the indentation, the result is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIqY1uwUa760aK_eNF8bRQ.png" /></figure><p>As you can see my compiler raised an error: an <em>IndentationError</em>, it means that I forgot to indent my code. This happens because Python doesn’t anything to close the line, like <strong>;</strong>(semicolon) in C++, neither parentheses to open the body of a function or statement, like {…}(curly brackets) in Swift. So the onlye way to make understand the compiler that a part of code is a body of a function or statement it’s the indentation.</p><h4>Variables</h4><p>As you can see on the example above, I wrote two numbers, <em>10 </em>and <em>20</em>, and I wrote them in this particular way: number1 = 20 and number2 = 10.</p><p>Well number1 and number2 are called variables. <strong>Variables</strong> are used to store information to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves.</p><p>In Python, variables are created when you assign a value to it: number1 = 20.</p><p>In other programming languages you should specify the type of a variable (integer, string, boolean), in Python you should just assign them the value and the compiler understand the type.</p><p>Don’t you believe me? Let’s try. In Python it exists a function called type()` that tells us the type of a variable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*5lND4bM-lcIMCx5pcZuSJQ.png" /></figure><p>As you can see the compiler said that the variable1 it’s an <em>integer value</em> and it’s true because we assigned to variable1 the value 10.</p><p>Differently from math the = sign doesn’t mean <em>it’s equal to</em>, but through this sign we assign, to what we wrote on the left of the =, the value on the right of the =. So basically it should be read from right to left.</p><h4>The if statement</h4><p>Last but not least it’s the if(): statement. In computer programming, a statement is <strong>a syntactic unit of an imperative programming language that expresses some action to be carried out</strong>.</p><p>Specifically the if(): statement perform an action <em>if a particular condition it’s true</em>. Condition that should be written in parentheses. To start the if(): statement we use a colon : to say to our compiler that a particular statement is starting.</p><h4>The else statement</h4><p>As you can imagine the else: statement follows the if(): statement. It performs an action <em>if the condition in the </em>if():<em> statement result to be false</em>. It takes no conditions and you start it with a colon :.</p><h4>The print function</h4><p>In Python the print() function has a lot of potential and I should write an entire article about the print() function. For now I would say that: if you want to print something on the screen you should use the print() function and you have to put your text between single &#39;’ or double &quot;” quotation marks. In this way: print(&quot;The text between quotation marks will be printed on the screen&quot;) or print(&#39;Also this text will be printed on the screen&#39;).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*dUM7dzXgV0DZ1AKBNJ5clA.png" /></figure><h4>Let’s code</h4><p>Now we have all the necessary tools to perform our first script in Python.</p><p>Let’s see how to compose an<em> if and else</em> statement.</p><p>What we want to see in this particular script is: we have two numbers and we want to know if the first number is greater than the second or viceversa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fT3YliB9WwBxwjm4IBYBXQ.png" /></figure><p>Congratulations! You’ve written your first script in Python! Stay tuned for other tutorials and try also by yourself to search for beginners tutorials on the internet: it’s the best way to learn a new programming language.</p><p>See ya, to the next article about Python! Cheers!!🍻</p><h3>References</h3><p><a href="https://jupyter.org/">https://jupyter.org/</a>, <a href="https://www.jetbrains.com/pycharm/download/#section=windows">https://www.jetbrains.com/pycharm/download/#section=windows</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6998f766b573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 geek girls that changed the world]]></title>
            <link>https://girolamopinto1.medium.com/10-geek-girls-that-changed-the-world-f1891700fd55?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1891700fd55</guid>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[stories-that-matter]]></category>
            <category><![CDATA[women]]></category>
            <category><![CDATA[curiosity]]></category>
            <category><![CDATA[8th-march]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 08:51:39 GMT</pubDate>
            <atom:updated>2022-03-08T08:51:39.141Z</atom:updated>
            <content:encoded><![CDATA[<h4>A female look to the world of technology</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GCRhiNyM_jEVNVQgW9Zbag.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jentheodore?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jen Theodore</a> on <a href="https://unsplash.com/s/photos/women-rights?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Welcome back, fellow readers! Today, 8th of March, it’s a beautiful day, and I want to celebrate it listing for you <strong>10 “nerd” women</strong> that changed the story of technology, giving us the best invetions and ideas that have given shape to our present.</p><p>Without further words, here we are: <strong>10 geek girls that changed the world</strong>.</p><h3>1. Ada Lovelace Byron — The mother of computers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*LBKYjofHBuc0qpWqMcikiA.png" /><figcaption>Ada Lovelace Byron portrait (<a href="https://medium.com/dataseries/ada-lovelace-the-mathematician-her-mother-an-algorithm-138031322e85">Image source</a>)</figcaption></figure><p>If <a href="https://en.wikipedia.org/wiki/Alan_Turing"><strong>Alan Turing</strong></a> is considered the father of modern computers, well <strong>Ada Lovelace Byron</strong> is for sure the mother.</p><p>Born in 1815 from the famous poet <a href="https://it.wikipedia.org/wiki/George_Gordon_Byron"><strong>George Gordon Byron</strong></a>, she is the only legitimate daughter of Byron and when she was just one year old, she was turned away from the mother. She wasn’t talented in poetry like his father, Lord Byron, but she developed a great passion for math and science in general.</p><p>When she was 17 years old, she met the man who changed her life: <a href="https://it.wikipedia.org/wiki/Charles_Babbage"><strong>Charles Babbage</strong></a><strong> </strong>a grumpy 42 years old man who was working to <em>difference engine</em>: a machine, very similar to a watch, capable of making calculations automatically. Basically you should insert numbers on one side and on the other you could see results of a sum or a subtraction, like a calculator.</p><p>Ada, who saw the various ideas of Babbage, guessed the potential of the <em>Analytical Machine</em>: not a simple calculator, but a symbolic machine capable of various applications. In her notes it was found also an algorithm that allows to calculate <a href="https://en.wikipedia.org/wiki/Bernoulli_process">Bernoulli numbers</a> and this gave her the title of “first world’s computer programmer”.</p><p>She died at the age of 37 years old and in 1979 United States’ Defence Department gave the name ADA to an efficient and agile programming language. You can find her story in the book by <a href="https://en.wikipedia.org/wiki/Walter_Isaacson"><strong>Walter Isaacson</strong> </a>“<a href="https://www.amazon.it/innovators-Walter-Isaacson/dp/1471138801/ref=sr_1_2?keywords=gli+innovatori%2C+walter+isaacson&amp;qid=1646581459&amp;sprefix=Gli+inno%2Caps%2C241&amp;sr=8-2"><em>The innovators</em></a>”.</p><h3>2. Hedy Lamarr — The nerd fatale</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*dixjXuZTVSTJfuZeR1KnTA.jpeg" /><figcaption>Hedy Lamarr publicity photo for the film <em>The Heavenly Body</em>, 1944 (<a href="https://en.wikipedia.org/wiki/Hedy_Lamarr">Image source</a>)</figcaption></figure><p>The appellative of “femme fatale” fro Hedy Lamarr it’s a must. Born in 1914 in Vienna, she was an Hollywood actress and she co-conceived the <em>frequency hopping spread spectrucm (fhss)</em>, a system which avoid radio interference. She was the first actress to interpret a nude scene in the film <a href="https://en.wikipedia.org/wiki/Ecstasy_(film)"><em>Ecstasy</em> </a>by<em> </em><a href="https://en.wikipedia.org/wiki/Gustav_Machat%C3%BD"><strong>Gustav Machatý</strong></a><strong>. </strong>The film was censored and in some countries, removed from the markets. She acted in more than 30 films, among which “Comrade X” and “Boom Town” co-starring with <a href="https://en.wikipedia.org/wiki/Clark_Gable"><strong>Clark Gable</strong></a><strong>.</strong></p><p>But she is famous also because she invented a modulation system, with registered patent in 1942, for coding information to be transmitted over radio frequencies, which would have made it possible to remotely control torpedoes and naval vessels. Lamarr patented this system together with her friend, the composer <a href="https://it.wikipedia.org/wiki/George_Antheil"><strong>George Antheil</strong></a><strong>, </strong>immediately arousing the interest of secret services and military apparatuses, and laying the foundations not only for cryptography, but also for mobile telephony and wireless computer systems.</p><h3>3. Karen Spärck Jones — The Google woman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*HFMlyI_FwebO4INc4WRiwA.jpeg" /><figcaption>Prof. Karen Spärck Jones, photographed in summer 2002 in front of the University of Cambridge Computer Laboratory (<a href="https://it.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones">Image source</a>)</figcaption></figure><p>If now we have search engine, like Google, we should thank this woman. Born in Yorkshire, in United Kingdom, in 1935, from a british chemical teacher father and a Norwegian mother, she took a bachelor degree in Philosophy before to dedicate her entire life to Computer Science.</p><p>She married a computer scientist and in 1972 she published “<em>A statistical interpretation of term specificity and its application in retrieval</em>”, which introduce the concept of <a href="https://www.sciencedirect.com/topics/computer-science/inverse-document-frequency"><em>inverse document frequency</em></a>. It’s basically one of the main components about algorithm classification to obtain a text from a document index automatically.</p><p>It was just a statistical theory, but in 1994 <a href="https://en.wikipedia.org/wiki/Mike_Burrows"><strong>Mike Burrows</strong></a>, a bicycle designer from Norwich, England, used this theory to create the search engine <a href="https://search.yahoo.com/?fr=altavista"><strong>Alta Vista</strong></a><strong>.</strong></p><p>Karen was an hi-tech feminist promoter, once she said:</p><blockquote>I think it’s very important to get more women into computing. My slogan is: Computing is too important to be left to men.</blockquote><h3>4. Margaret Hamilton — The woman of the moon</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*FUsaTizlEZCmpNnHwddUbQ.jpeg" /><figcaption>Computer scientist Margaret Hamilton poses with the Apollo guidance software she and her team developed at MIT. Credit: Courtesy MIT Museum (<a href="https://solarsystem.nasa.gov/people/320/margaret-hamilton/">Image source</a>)</figcaption></figure><p>If <a href="https://en.wikipedia.org/wiki/Neil_Armstrong"><strong>Neil Armstrong</strong></a> landed on the moon, he should thank this woman and her whole team. Born in 1936, she was the director of Software Engineering Division of MIT Instrumentation Laboratory, which developed the on-board software for <a href="https://www.nasa.gov/mission_pages/apollo/missions/apollo11.html"><strong>Apollo 11</strong></a>. Margaret’s team solved complications about the landing of Apollo 11 on the Moon, granting the mission success.</p><p>In 1986, Margaret Hamilton founded the <a href="http://www.htius.com/"><strong>Hamilton Technologies</strong></a> in Cambridge, Massachusetts, a company born to develop the <a href="http://www.htius.com/"><strong>Universal Systems Language (USL)</strong></a> based on the paradigm of <strong>Development Before the Fact (DBTF)</strong>, for the design of softwares and systems.</p><p>For her work during preparation of Apollo 11 mission, Hamilton has been credited with popularizing the concept of software engineering.</p><blockquote>We had to find a way and we did. Looking back, we were the luckiest people in the world; there was no choice but to be pioneers.</blockquote><blockquote>- Margaret Hamilton</blockquote><h3>5. Katherine Goble — The hidden figure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmgAxX30E2TLZEnobK2-sA.jpeg" /><figcaption>Katherine Johnson, also Katherine Coleman Goble Johnson, 1983; see <a href="https://crgis.ndc.nasa.gov/historic/Katherine_Johnson">NASA bio</a> (<a href="https://en.wikipedia.org/wiki/Katherine_Johnson">Image source</a>)</figcaption></figure><p>Staying on the moon theme, another woman who changed space travels was <strong>Katherine Johnson</strong>, whose story was told in the film “<a href="https://en.wikipedia.org/wiki/Hidden_Figures">Hidden figures</a>” directed by Theodore Melfi and written by Melfi and Allison Schroeder.</p><p>Passed away on the 20th January 2020, Katherine was born in 1918 in White Sulphur Springs and already at an early age she was considered a mathematical genius. Graduated in high-school at the age of 14, she was noted by a teacher in her university, in West Virginia State University, who invited her to follow the hardest courses about analytical mathematics, designed just for her.</p><p>Assumed at NACA, then became <a href="https://www.nasa.gov/"><strong>NASA</strong></a>, she contributed to calculate the spatial trajectories for <a href="https://en.wikipedia.org/wiki/Alan_Shepard"><strong>Alan Shepard</strong></a> mission, the first american man in the space, in 1959. She also took care of math calculations related to <a href="https://en.wikipedia.org/wiki/John_Glenn"><strong>John Glenn</strong></a>’s orbit around the earth in 1962 and then she calculated trajectory of Apollo 11 in 1969.</p><p>Katherine Johnson is an example of how despite the aversions of a country (she was a black woman) tenacity and willpower can help you move forward in life and grab the success you deserve.</p><h3>6. Helen Greiner — The Robo-mother</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*IZtlZVFRfJSj6Y1JaMHqiw.jpeg" /><figcaption>Helen Greiner speaks onstage during day one of TechCrunch Disrupt SF 2015 at Pier 70 on September 21, 2015 in San Francisco, California. (Photo by Steve Jennings/Getty Images for TechCrunch) (<a href="https://en.wikipedia.org/wiki/Helen_Greiner">Image source</a>)</figcaption></figure><p>Co-founder and president of <a href="https://www.irobot.com/"><strong>iRobot Corporation</strong></a>, Helen contributed significantly to improve mechanical devices, which perform actions automatically or remotely driven, accessibility.</p><p>Initially the majority of <strong>iRobot </strong>invetions were just for military use, but thanks to ever decreasing costs of technology, the company started to enter in the consumer market of robotics. Greiner said that in a few years there will be a robot in every house which will do houseworks or babysitting.</p><p>Her objective is “making robots available for everyone”. In 2020 she became CEO of <a href="https://tertill.com/"><strong>Tertill</strong></a>, a Boston startup which provides robots for gardening.</p><h3>7. Dorothy Vaughan — The Fortran Mistress</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*FIg5JSAmzI6Zf8uDX0t5VA.jpeg" /><figcaption>Dorothy Vaughan is one of NASA’s Hidden Figures. She was the first black female Supervisor, working on the IBM machine. Inducted into the Langley Hall of Honor, June 1, 2017. (<a href="https://en.wikipedia.org/wiki/Dorothy_Vaughan">Image source</a>)</figcaption></figure><p>Maybe most of you don’t know <strong>FORTRAN (or formula translation) </strong>as a<strong> </strong>programming language or never used it to program some mathematical operations. Well, this is not the case of <strong>Dorothy Vaughan</strong>, an American mathematician and human computer who worked at <strong>NASA</strong>, during the same years of <strong>Katherine Goble</strong>.</p><p>During her 28-year career, Vaughan prepared for the introduction of machine computers in the early 1960s by teaching herself and her staff the programming language of Fortran, the first high-level programming language invented by John Backus for IBM in 1954, released commercially in 1957.</p><p>As a black woman, Dorothy encountered several difficulties in her work, but thanks to her work and dedication, the NASA had the opportunity to use the <strong>IBM 7090 DPS (Data Processing System)</strong>, to calculate the orbit around the earth that it should have made by John Glenn in 1962.</p><h3>8. Adele Goldberg — The queen of software</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEJYlzMOEYm9O983whTusw.jpeg" /><figcaption>Adele Goldberg speaking at PyCon 2007. (<a href="https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist)">Image source</a>)</figcaption></figure><p>Born in Ohio in 1945, took a degree in mathematics then a master in computer science, <strong>Adele Goldberg</strong> is one of the most known and respected person in software industry. She worked for many years in the research centre <a href="https://www.xerox.it/it-it/innovazione/xerox-research-centre-of-canada"><strong>Xerox </strong></a>and she is co-founder of <a href="http://www.edm2.com/index.php/ParcPlace-Digitalk"><strong>ParcPlace-Digitalk</strong></a>, a company that develops applications for corporate software’s developers.</p><p>She was also president of <a href="https://www.acm.org/"><strong>Acm (Association for Computing Machinery)</strong></a><strong> </strong>and she received many awards for the contrbution to information technology. With <a href="https://en.wikipedia.org/wiki/Alan_Kay"><strong>Alan Kay</strong></a> she developed <a href="https://en.wikipedia.org/wiki/Smalltalk"><strong>SmallTalk</strong></a>, an object-oriented, dynamically typed reflective programming language.</p><p>Her motto is:</p><blockquote>Don’t ask yourself if you can do something, but how to do it</blockquote><h3>9. Arianna Menciassi — The geek girl from Tuscany</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*PIqum-cjZ5V4Bw-7OOk_9g.jpeg" /><figcaption>Intervento di Arianna Menciassi | Women&amp;Technologies: e-Health (Edizione 2011) (<a href="https://www.womentech.eu/persona/arianna-menciassi">Image source</a>)</figcaption></figure><p>A physics degree in 1995, in the same year she started to working in the Research Center in Microengineering of the Scuola Superiore Sant’Anna in Pisa, where she started her path as PhD on manipulation techniques of mechanical and biological micro objects, Arianna is one of the Italian and above all female pride in the field of bio-medical robotics.</p><p>In 2001, for the research in Pisa, she won the Best Manipulation Paper Award at the International Robotics and Automation Conference (Seoul, South Korea). Her work is mainly focused on biomedical and surgical robotics, microsystem technologies and the application of micro and nano-technologies to diagnostics and therapy. In 2020 Arianna with her team won the <a href="https://www.gonews.it/2020/11/18/robotica-sant-anna-kuka-menciassi/"><strong>“KUKA Innovation Award 2020 — Medical Robotics Challenge”</strong></a><strong>.</strong></p><p>She said:</p><blockquote>The world of traditional robotics, therefore industrial robotics, is very masculine, but biomedical robotics, and biomedical engineering in general, are a mixed world. This is because the biomedical aspect of robotics attracts a lot of women, who think about the utility and social value of what they do perhaps more than men</blockquote><h3>10. Samantha Cristoforetti — The space walker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFETNBkd0116qwtIrl_0fw.jpeg" /><figcaption>European Space Agency astronaut Samantha Cristoforetti, attired in her blue flight suit. (<a href="https://it.wikipedia.org/wiki/Samantha_Cristoforetti">Image source</a>)</figcaption></figure><p>Born in Milan, in 1977, then a degree in mechanical engineering in Munich, <strong>Samantha</strong> is one the italian symbols. She was the first italian woman (the third in Europe) to go in the space.</p><p>During the mission she conducted human physiology experiments (from the University of Ferrara), biological analyzes (wearable monitoring studied by the <a href="https://www.dongnocchi.it/"><strong>Don Carlo Gnocchi Onlus Foundation</strong></a>) and experimented with the printing of 3D objects in weightlessness, designed by the Italian companies <a href="https://capgemini-engineering.com/it/it/chi-siamo/introduzione/"><strong>Altran</strong> </a>and <a href="https://www.thalesgroup.com/it/global/activities/space"><strong>Thales Alesia Space</strong></a>.</p><p>Samantha speaks fluently 5 languages: Italian, French, Russian, English and German. In 2022 she will leave the Earth again to come back on the International Space Station to make other experiments about reproductions of metal parts thanks to spatial 3D printers.</p><p>All these women, all their tenacity, all their desire to change and improve the world, must remind us that we are all equal in the world, no matter the gender. We should remind also that if we really want to make a difference, we need to be fully committed to ourselves. And the first commitment we should make is to respect all people, regardless of gender or skin color.<br>Happy women’s day, fellow readers.</p><h3>References</h3><p><a href="https://medium.com/dataseries/ada-lovelace-the-mathematician-her-mother-an-algorithm-138031322e85">https://medium.com/dataseries/ada-lovelace-the-mathematician-her-mother-an-algorithm-138031322e85</a>, <a href="https://en.wikipedia.org/wiki/Alan_Turing">https://en.wikipedia.org/wiki/Alan_Turing</a>, <a href="https://it.wikipedia.org/wiki/George_Gordon_Byron">https://it.wikipedia.org/wiki/George_Gordon_Byron</a>, <a href="https://it.wikipedia.org/wiki/Charles_Babbage">https://it.wikipedia.org/wiki/Charles_Babbage</a>, <a href="https://en.wikipedia.org/wiki/Bernoulli_process">https://en.wikipedia.org/wiki/Bernoulli_process</a>, <a href="https://en.wikipedia.org/wiki/Walter_Isaacson">https://en.wikipedia.org/wiki/Walter_Isaacson</a>, <a href="https://en.wikipedia.org/wiki/Gustav_Machat%C3%BD">https://en.wikipedia.org/wiki/Gustav_Machat%C3%BD</a>, <a href="https://en.wikipedia.org/wiki/Ecstasy_(film)">https://en.wikipedia.org/wiki/Ecstasy_(film)</a>, <a href="http://dearmrgable.com/?page_id=4027">http://dearmrgable.com/?page_id=4027</a>, <a href="https://en.wikipedia.org/wiki/Clark_Gable">https://en.wikipedia.org/wiki/Clark_Gable</a>, <a href="https://en.wikipedia.org/wiki/Hedy_Lamarr">https://en.wikipedia.org/wiki/Hedy_Lamarr</a>, <a href="https://it.wikipedia.org/wiki/George_Antheil">https://it.wikipedia.org/wiki/George_Antheil</a>, <a href="https://it.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones">https://it.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones</a>, <a href="https://www.sciencedirect.com/topics/computer-science/inverse-document-frequency">https://www.sciencedirect.com/topics/computer-science/inverse-document-frequency</a>, <a href="https://en.wikipedia.org/wiki/Mike_Burrows">https://en.wikipedia.org/wiki/Mike_Burrows</a>, <a href="https://search.yahoo.com/?fr=altavista">https://search.yahoo.com/?fr=altavista</a>, <a href="https://solarsystem.nasa.gov/people/320/margaret-hamilton/">https://solarsystem.nasa.gov/people/320/margaret-hamilton/</a>, <a href="https://www.nasa.gov/mission_pages/apollo/missions/apollo11.html">https://www.nasa.gov/mission_pages/apollo/missions/apollo11.html</a>, <a href="https://www.economyup.it/innovazione/donne-e-tecnologia-15-nerd-che-hanno-fatto-la-storia/">https://www.economyup.it/innovazione/donne-e-tecnologia-15-nerd-che-hanno-fatto-la-storia/</a>, <a href="https://www.britannica.com/biography/Margaret-Hamilton-American-computer-scientist">https://www.britannica.com/biography/Margaret-Hamilton-American-computer-scientist</a>, <a href="https://en.wikipedia.org/wiki/Neil_Armstrong">https://en.wikipedia.org/wiki/Neil_Armstrong</a>, <a href="https://en.wikipedia.org/wiki/Katherine_Johnson">https://en.wikipedia.org/wiki/Katherine_Johnson</a>, <a href="https://en.wikipedia.org/wiki/Hidden_Figures">https://en.wikipedia.org/wiki/Hidden_Figures</a>, <a href="https://www.nasa.gov/">https://www.nasa.gov/</a>, <a href="https://en.wikipedia.org/wiki/Alan_Shepard">https://en.wikipedia.org/wiki/Alan_Shepard</a>, <a href="https://en.wikipedia.org/wiki/Helen_Greiner">https://en.wikipedia.org/wiki/Helen_Greiner</a>, <a href="https://tertill.com/">https://tertill.com/</a>, <a href="https://www.irobot.com/">https://www.irobot.com/</a>, <a href="https://it.wikipedia.org/wiki/IBM_7090">https://it.wikipedia.org/wiki/IBM_7090</a>, <a href="https://fortran-lang.org/">https://fortran-lang.org/</a>, <a href="https://en.wikipedia.org/wiki/Dorothy_Vaughan">https://en.wikipedia.org/wiki/Dorothy_Vaughan</a>, <a href="https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist)">https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist)</a>, <a href="https://www.xerox.it/it-it/innovazione/xerox-research-centre-of-canada">https://www.xerox.it/it-it/innovazione/xerox-research-centre-of-canada</a>, <a href="http://www.edm2.com/index.php/ParcPlace-Digitalk">http://www.edm2.com/index.php/ParcPlace-Digitalk</a>, <a href="https://www.acm.org/">https://www.acm.org/</a>, <a href="https://en.wikipedia.org/wiki/Smalltalk">https://en.wikipedia.org/wiki/Smalltalk</a>, <a href="https://en.wikipedia.org/wiki/Alan_Kay">https://en.wikipedia.org/wiki/Alan_Kay</a>, <a href="https://www.womentech.eu/persona/arianna-menciassi">https://www.womentech.eu/persona/arianna-menciassi</a>, <a href="https://www.gonews.it/2020/11/18/robotica-sant-anna-kuka-menciassi/">https://www.gonews.it/2020/11/18/robotica-sant-anna-kuka-menciassi/</a>, <a href="https://it.wikipedia.org/wiki/Samantha_Cristoforetti">https://it.wikipedia.org/wiki/Samantha_Cristoforetti</a>, <a href="https://www.thalesgroup.com/it/global/activities/space">https://www.thalesgroup.com/it/global/activities/space</a>, <a href="https://capgemini-engineering.com/it/it/chi-siamo/introduzione/">https://capgemini-engineering.com/it/it/chi-siamo/introduzione/</a>, <a href="https://www.dongnocchi.it/">https://www.dongnocchi.it/</a>,</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1891700fd55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bluetooth — A connection with Valhalla]]></title>
            <link>https://girolamopinto1.medium.com/bluetooth-a-connection-with-valhalla-7405b70b71cf?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7405b70b71cf</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[bluetooth]]></category>
            <category><![CDATA[vikings]]></category>
            <category><![CDATA[curiosity]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Sat, 05 Mar 2022 09:24:18 GMT</pubDate>
            <atom:updated>2022-03-05T09:24:18.568Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bluetooth — A connection with Valhalla</h3><h4>The Vikings origins of most popular data transfer system</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ca-yV5mgmV29sJBXVwsCbw.png" /><figcaption>Bluetooth official logo (<a href="https://freepngimg.com/png/26805-bluetooth-hd/icon">Click here for image source</a>)</figcaption></figure><p>It all started with a drink, a book about Vikings and three men with a vision. In short, it started like many others stories about changing the world of technology.</p><p>Don’t you trust me? Well, I think that <strong>Nils Rydbeck</strong>, CTO at Ericsson Mobile in Lund, Sweden, <strong>Sven Mattison</strong>, senior expert in analog-system design at Ericsson Research, and <strong>Jim Kardach</strong> of <strong>Intel </strong>have something very special to tell you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*CuzhnY-gA9qOZ4foxiQQjA.jpeg" /><figcaption>Nils Rydbeck (Manager, Ericsson Mobile Telephone Laboratory in Lund) and Flemming Örneholm (Manager, Mobile Telephone Operations) (<a href="https://www.ericsson.com/en/about-us/history/changing-the-world/world-leadership/smaller-and-smaller">Click here for image source</a>)</figcaption></figure><p>In 1989, precisely, Rydbeck was working on the development of wireless headsets, to boost the sales of Ericsson.</p><p>Principal design and development began in 1994 and only in 1997, engineers had a workable solution.</p><p>Just in 1997, <strong>Adalio Sanchez</strong>, the head of <strong>IBM</strong> <strong>ThinkPad</strong> product <strong>R&amp;D</strong>, approached Nyls Rydbeck about collaborating on integrating a mobile phone in a ThinkPad notebook. Unfortunately, they came to the conclusion that power consumption on cellphone technology at that time was too high to allow viable integration into a notebook and still achieve adequate battery life. So they agreed to put the Ericsson’ short-link on both, IBM ThinkPad and Ericsson’s phones.</p><p>But you probably are wondering: if Ericsson company, in collaboration with IBM ThinkPad, developed this technology, why there are so many agencies that are using this connection system nowadays?</p><p>Well at that time, since both Ericsson and IBM ThinkPad notebook were not the market share leaders in their respective markets, Adalio Sanchez and Nyls Rydbeck agreed to make the short-link technology an <em>open industry standard</em>, to permit each player maximum market access.</p><p>In May 1998 the <strong>Bluetooth SIG (Special Interest Group)</strong> was launched with IBM and Ericsson as the founding signatories and a total of five members: Ericsson, IBM, Nokia, Intel and Toshiba.</p><p>It remains just a little question: why Bluetooth and Vikings are related?</p><p>Well, in 1997 <strong>Jim Kardach</strong> of Intel, one of the founders of the Bluetooth SIG, proposed this name, inspired by a conversation with <strong>Sven Mattison</strong>, considered the father of the Bluetooth and today senior expert in analog-system design at Ericsson Research.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxqBsH4xZo5GtZcS5SfIJw.jpeg" /><figcaption>Sven Mattisson, the father of Bluetooth (<a href="https://www.iva.se/publicerat/sven-mattisson-har-tilldelats-adelskoldska-medaljen/">Click here for image source</a>)</figcaption></figure><p>Jim and Sven were having a drink together and Sven told that he was reading <a href="https://en.wikipedia.org/wiki/The_Long_Ships"><strong>The Long Ships</strong></a> by <a href="https://en.wikipedia.org/wiki/Frans_G._Bengtsson"><strong>Frans G. Bengtsson</strong></a>, a historical novel about Vikings and the Danish king <a href="https://en.wikipedia.org/wiki/Harald_Bluetooth"><strong>Harald</strong> “<strong>Bluetooth</strong>” <strong>Gormsson</strong></a><strong>.</strong></p><p>Jim proposed <em>Bluetooth </em>as the codename for the short-range wireless program. And, according to Bluetooth’s official website:</p><blockquote>Bluetooth was only intended as a placeholder until marketing could come up with something really cool.</blockquote><blockquote>Later, when it came time to select a serious name, Bluetooth was to be replaced with either RadioWire or PAN (Personal Area Networking). PAN was the front runner, but an exhaustive search discovered it already had tens of thousands of hits throughout the internet.</blockquote><blockquote>A full trademark search on RadioWire couldn’t be completed in time for launch, making Bluetooth the only choice. The name caught on fast and before it could be changed, it spread throughout the industry, becoming synonymous with short-range wireless technology.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*evDT-yWLY-ctnOmL7XwFng.jpeg" /><figcaption>Harald “Bluetooth” Gormsson<strong> </strong>(c. 910-c. 987) (<a href="https://it.mahnazmezon.com/articles/humanities/biography-of-harald-bluetooth-former-king-of-denmark-and-norway.html">Click here for image source</a>)</figcaption></figure><p><em>Bluetooth </em>was the epithet of King Harald who united the disparate Danish tribes into a single kingdom. So Kardach choosed the name to imply that Bluetooth similarly unites communication protocols.</p><p>There are many interpretations about the epithet of king Harald I, Bluetooth. Some people say that he had a rotten tooth and the color of his tooth was nearly to blue. But the most accredited hypothesis is that, like many other Vikings at that time, Harald used to paint parts of his body, like the face, the arms and even the teeth.</p><p>There have been found humans remains, like skulls, where archeologists noted that teeth had a colour nearly to blue, maybe a natural dye extracted from flowers that Vikings used to scare their enemies.</p><p>But, hold on, because curiosities are not over yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ejyQHvJEIkkF5SAhWJBrqA.png" /><figcaption>Bluetooth logo (<a href="https://www.meteda.it/prodotto/abi-test/attachment/bluetooth-logo/">Click here for image source</a>)</figcaption></figure><p>Have you ever noticed how is strange the Bluetooth logo? Well, since <em>Bluetooth </em>was becoming the official name of Ericsson’ short-link and since the relation with Vikings, they decided to put something about <em>North people</em> inside the logo of the new Bluetooth SIG.</p><p>And what was better of Vikings runes?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXy6BlfxiJFeZJi5o99t8w.png" /><figcaption>Nordic “H” and Nordic “B” (<a href="https://www.saperescienza.it/rubriche/fisica-e-tecnologia/la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu/2893-la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu">Click here for image source</a>)</figcaption></figure><p>The runes ᚼ and ᛒ, which we see united in the logo, refer to King Harold I, with the H of Harald and the B of Blåtand, blue tooth in Danish. The result is a bind rune, a Migration Period Germanic ligature of two or more runes.</p><p>I really think that, at this point, the choice of the background color needs no explanation.</p><p>The Bluetooth and its Vikings origins, it’s a beautiful example that building a story behind a brand can help it (and your company as well), to grow up and to become a leader in a particular sector. This, obviously, doesn’t involve just technology and we all should take example from Bluetooth and Ericsson.</p><p>Today the bluetooth is used in thousands of devices, you can think to all wireless earphones, or virtual assistant like <strong>Alexa </strong>or <strong>Google, </strong>that interact with tons of devices like lights, plugs or even<strong> </strong>entire electrical systems. Even our smartphones use Bluetooth to communicate with other devices (included smartphones themselves).</p><p>In short, Bluetooth became an important part of our lives and it’s unbelievable thinking that it all started from a book and a flash of fantasy.</p><h3>References</h3><ol><li><a href="https://www.saperescienza.it/rubriche/fisica-e-tecnologia/la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu/2893-la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu">https://www.saperescienza.it/rubriche/fisica-e-tecnologia/la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu/2893-la-curiosa-storia-del-bluetooth-e-il-vichingo-dai-denti-blu</a></li><li><a href="https://marcolazzara.net/tag/jim-kardach/">https://marcolazzara.net/tag/jim-kardach/</a></li><li><a href="https://www.ericsson.com/en/about-us/history/changing-the-world/world-leadership/smaller-and-smaller">https://www.ericsson.com/en/about-us/history/changing-the-world/world-leadership/smaller-and-smaller</a></li><li><a href="https://ieeexplore.ieee.org/author/37265020200">https://ieeexplore.ieee.org/author/37265020200</a></li><li><a href="https://www.iva.se/publicerat/sven-mattisson-har-tilldelats-adelskoldska-medaljen/">https://www.iva.se/publicerat/sven-mattisson-har-tilldelats-adelskoldska-medaljen/</a></li><li><a href="https://it.mahnazmezon.com/articles/humanities/biography-of-harald-bluetooth-former-king-of-denmark-and-norway.html">https://it.mahnazmezon.com/articles/humanities/biography-of-harald-bluetooth-former-king-of-denmark-and-norway.html</a></li><li><a href="https://en.wikipedia.org/wiki/Harald_Bluetooth">https://en.wikipedia.org/wiki/Harald_Bluetooth</a></li><li><a href="https://en.wikipedia.org/wiki/Frans_G._Bengtsson">https://en.wikipedia.org/wiki/Frans_G._Bengtsson</a></li><li><a href="https://en.wikipedia.org/wiki/The_Long_Ships">https://en.wikipedia.org/wiki/The_Long_Ships</a></li><li><a href="https://en.wikipedia.org/wiki/Bluetooth">https://en.wikipedia.org/wiki/Bluetooth</a></li><li><a href="https://en.wikipedia.org/wiki/Bind_rune">https://en.wikipedia.org/wiki/Bind_rune</a></li><li><a href="https://www.meteda.it/prodotto/abi-test/attachment/bluetooth-logo/">https://www.meteda.it/prodotto/abi-test/attachment/bluetooth-logo/</a></li><li><a href="https://freepngimg.com/png/26805-bluetooth-hd/icon">https://freepngimg.com/png/26805-bluetooth-hd/icon</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7405b70b71cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Python 3 on Microsoft Windows]]></title>
            <link>https://girolamopinto1.medium.com/install-python-3-on-microsoft-windows-a2df9b48ef9f?source=rss-b18908656b3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2df9b48ef9f</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Girolamo Pinto]]></dc:creator>
            <pubDate>Tue, 01 Mar 2022 16:56:51 GMT</pubDate>
            <atom:updated>2022-03-01T16:56:51.965Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XINFyX6WGpr3ueOj" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=medium&amp;utm_medium=referral">Chris Ried</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Welcome back, developers!</p><p>Today, in this brief story, I want to share with you another part of my journey to become a software developer. And I’ll begin this new bunch of stories talking about the new programming language that I’m learning nowadays: Python.</p><p>Are you ready to follow me in this beautiful journey? Let’s go!</p><h3>Introduction</h3><p>First, it’s crucial to understand that, unlike many other programming languages, Python should be installed on your PC, you can’t just download an IDE and start to work with it.</p><p><strong>Note </strong>: You can do it, but you would lose a lot of potential from this programming language, so take this like a little advice.</p><p>Follow these easy steps and in a few minutes you will have Python on your machine and you can start coding with it.</p><p><strong>Note </strong>: We will install the newest version of Python on our machines, at the moment I’m writing this I’m using Python 3. Things can change (software developers know well this sh@*t), so in case there will be some changes I will post another article.</p><p>Now stop with the boring part and let’s start!</p><h3>Installing Python on Windows PC</h3><p>First of all, you should know that there are three methods to install Python on your machines, I will display all the methods here, than you can choose whatever method you prefer:</p><ol><li><strong>The Microsoft Store</strong> : This method involves installing Python from the Microsoft Store app. This is recommended for beginner Python users looking for an easy-to-set-up experience.</li><li><strong>The full installer</strong> : This approach involves downloading Python directly from the <a href="https://www.python.org/">Python.org website</a>. This is recommended for intermediate and advanced developers who need more control during the setup process.</li><li><strong>Windows Subsystem for Linux</strong> : The WSL allows you to run a Linux environment directly in Windows. If you don’t know how to enable the WSL on your Windows PC you can check the <a href="https://docs.microsoft.com/it-it/windows/wsl/install">Microsoft Documentation on Installing WSL on Windows</a>.</li></ol><p><strong>Note</strong>: In this section, we’ll focus on only the first two options, which are the most popular installation methods in a Windows environment.</p><p>Before to install Python let’s check if we already have Python on our Windows machine.</p><h4>How to check Python version on Windows</h4><p>First let’s open the <strong>PowerShell.</strong></p><ol><li>Type <strong>PowerShell</strong> in <strong>Search Bar</strong></li><li>Then press <strong>Enter</strong></li></ol><p>After you opened the PowerShell, type:</p><p>python --version</p><p>The --version switch will allows you to check what version of Python is installed on your machine. In either case, if you see a version less than 3.10, which was the most recent version at the time of writing, then you’ll want to upgrade your installation.</p><p><strong>Note:</strong> If you don’t have a version of Python on your system, the above command will launch the Microsoft Store and redirect you to the Python application page. You’ll see how to complete the installation from the Microsoft Store in the next section.</p><p>If you’re interested in where the installation is located, then you can use the where.exe command, in this way:</p><p>where.exe python</p><p><strong>Note</strong>: Remember that the where.exe command will work only if Python is installed on your machine.</p><p><strong>Note</strong>: Remember that the power shell commands are <em>case sensitive</em> and <em>space sensitive </em>use spaces or upper/lower cases where needed.</p><h4>Install Python with Microsoft Store</h4><p>The official Python documentation has this to say about the Microsoft Store package:</p><blockquote>The Microsoft Store package is an easily installable Python interpreter that is intended mainly for interactive use, for example, by students. (<a href="https://docs.python.org/3/using/windows.html#the-microsoft-store-package">Source</a>)</blockquote><p>The key takeaway here is that the Microsoft Store package is “intended mainly for interactive use.” That is, the Microsoft Store package is designed to be used by students and people learning to use Python for the first time.</p><p>To install Python with Microsoft Store, follows these two easy steps:</p><ol><li>Open the <strong>Microsoft Store</strong> app and search for Python.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbTRsaU5zPbsEP1b1KoCyw.png" /></figure><p>As you can see you can choose among multiple versions.</p><p>Select <em>Python 3.10, </em>or the highest version number you see available in the app, to open the installation page.</p><p><strong>Warning:</strong> Make sure that the Python application you’ve selected is created by the <strong>Python Software Foundation</strong>. The official Microsoft Store package will always be free, so if the application costs money, then it’s the <strong>wrong</strong> application.</p><p><strong>Note</strong>: you can open PowerShell and type python , in this way you will open the Microsoft Store on the latest version of Python.</p><p>2. Install the <strong>Python</strong> app</p><p>After you’ve selected the version to be installed, follow these steps to complete the installation:</p><ol><li>Click <em>Get</em>.</li><li>Wait for the application to download. When it’s finished downloading, the <em>Get</em> button will be replaced with a button that says <em>Install on my devices</em>.</li><li>Click <em>Install on my devices</em> and select the devices on which you’d like to complete the installation.</li><li>Click <em>Install Now</em> and then <em>OK</em> to start the installation.</li><li>If the installation was successful, then you’ll see the message “This product is installed” at the top of the Microsoft Store page.</li></ol><p>Congratulations! You now have access to Python, including <a href="https://www.w3schools.com/python/python_pip.asp">pip </a>and <a href="https://docs.python.org/3/library/idle.html">IDLE</a>!</p><h4>How to install Python with the Full Installer</h4><p>Follow these steps to download the full installer:</p><ol><li>Open a browser window and navigate to the Python.org <a href="https://www.python.org/downloads/windows/">Downloads page for Windows</a>.</li><li>Under the “Python Releases for Windows” heading, click the link for the <em>Latest Python 3 Release — Python 3.x.x</em>. As of this writing, the latest version was Python 3.10.</li><li>Scroll to the bottom and select either <em>Windows x86–64 executable installer for 64-bit</em> or <em>Windows x86 executable installer for 32-bit</em>.</li></ol><p>When the installer is finished downloading, run the installer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*NrenptSg1Qd0cZY1JWD1yQ.png" /></figure><p>The full installer gives you total control over the installation process.</p><p>Then click <em>Install Now</em>. That’s all there is to it!</p><p>Congratulations, you now have the latest version of Python 3 on your Windows machine!</p><p>Thank all of you for reading this article. I hope that I helped someone who is struggling with the installation of Python 3.</p><p>I will post more about Python in Windows, so see you soon in the next article. Cheers!!🍻</p><h3>References</h3><ol><li><a href="https://realpython.com/installing-python/#how-to-install-python-on-windows">https://realpython.com/installing-python/#how-to-install-python-on-windows</a></li><li><a href="https://medium.com/codex/python-for-absolute-beginners-cfcc23cca074">https://medium.com/codex/python-for-absolute-beginners-cfcc23cca074</a></li><li><a href="https://docs.python.org/3/">https://docs.python.org/3/</a></li><li><a href="https://www.w3schools.com/python/default.asp">https://www.w3schools.com/python/default.asp</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2df9b48ef9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>