<?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 Fabio Motta on Medium]]></title>
        <description><![CDATA[Stories by Fabio Motta on Medium]]></description>
        <link>https://medium.com/@fabiomotta98?source=rss-1c67e0f21e34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KOD6ajvHEhmqXD2BXouxHQ.jpeg</url>
            <title>Stories by Fabio Motta on Medium</title>
            <link>https://medium.com/@fabiomotta98?source=rss-1c67e0f21e34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:01:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fabiomotta98/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[The Art of Prompt Engineering: A Beginner’s Guide to Getting the Best from AI]]></title>
            <link>https://fabiomotta98.medium.com/the-art-of-prompt-engineering-a-beginners-guide-to-getting-the-best-from-ai-5964ec8d3e84?source=rss-1c67e0f21e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/5964ec8d3e84</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Fabio Motta]]></dc:creator>
            <pubDate>Wed, 04 Dec 2024 22:46:29 GMT</pubDate>
            <atom:updated>2024-12-05T21:38:48.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wKssRSQ1Fmcd59HX" /><figcaption>Photo by <a href="https://unsplash.com/@bhautik_patel3?utm_source=medium&amp;utm_medium=referral">Bhautik Patel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Artificial intelligence (AI) tools are becoming more common in our daily lives. From writing emails to brainstorming ideas, they can be powerful assistants. Yet, many people shy away from using them because they’re unsure how to start. The secret? <strong>Prompt engineering</strong>.</p><p>If you’ve ever been frustrated by a chatbot’s unhelpful response or puzzled by how to make AI work for you, this guide is for you. You don’t need to be a tech wizard to use AI effectively. You just need to know how to ask the right questions.</p><h3>What Is Prompt Engineering?</h3><p>Think of prompt engineering like crafting a question or instruction for AI to follow. A “prompt” is what you type into an AI tool, like ChatGPT, to tell it what you want. Prompt engineering is the skill of designing these prompts so the AI gives you the best response. The better and more specific your prompt, the better the AI’s response. With a bit of practice, you can use prompt engineering to get exactly what you need in a short time, whether it’s creating content, solving problems, or learning something new.</p><h3>5 Key Tips for Effective Prompt Engineering</h3><h3>1. Be Clear and Specific</h3><p>Vague prompts lead to vague answers. Clearly describe what you want, and include details like style, format, or tone.</p><p><strong>Example:</strong></p><ul><li><strong>Vague</strong>: “Design a holiday for me”</li><li><strong>Specific</strong>: “Give me 5 budget-friendly travel destinations in Europe for a family with two young kids, with a short description for each.”</li></ul><h3>2. Break Down Complex Requests</h3><p>If your task is complicated, break it into smaller steps. This helps the AI focus on one thing at a time.</p><p><strong>Example:</strong> Instead of asking:<br>“Write a business plan”</p><p>Start with:<br>“List the key sections of a business plan,”<br>then follow up with prompts like:<br>“Expand on the marketing strategy section.”</p><h3>3. Provide Context</h3><p>Give the AI enough background to understand your needs. The more context, the better it can tailor the response.</p><p><strong>Example:</strong></p><ul><li>Without context: “Suggest a recipe.”</li><li>With context: “Suggest a recipe for a quick vegetarian dinner for two, using ingredients like spinach, pasta, and cheese.”</li></ul><h3>4. Experiment with Tone and Style</h3><p>Want a formal email? Or a playful tweet? Tell the AI what tone to use.</p><p><strong>Example:</strong></p><ul><li>“Write an email apologizing for a delay in shipment in a professional tone.”</li><li>“Write a witty tweet about being stuck in traffic.”</li></ul><h3>5. Use Examples</h3><p>If you have a specific idea or style of what you want, share an example in your prompt.</p><p><strong>Example:</strong></p><ul><li>“Write a product description for a smartwatch. Here’s an example for a smartphone: [Insert example]. Make the smartwatch description similar in tone and structure.”</li><li>“Write an invitation to my birthday party for my friends. This is the one I sent last year, use the same tone and style: [Insert example]”</li></ul><h3>Templates: A Prompt Engineering Shortcut</h3><p>Writing powerful prompts takes time! One of the easiest ways to use AI effectively is to use <strong>templates</strong> — pre-designed prompts you can re-use and adapt to different tasks. Here are some examples to get you started:</p><h3>Template for Content Creation</h3><blockquote><em>“Write a [type of content] about [topic] for [audience]. Keep it [tone/style], and include [specific elements].”</em></blockquote><p><strong>Example:</strong><br>“Write a LinkedIn post about hiring strategies for young managers. Keep it funny and engaging, and include example icebreakers and interview questions. Write in a tone similar to the one I used in this previous post: [insert previous post here].”</p><h3>Template for Learning</h3><blockquote><em>“Explain [topic] in three sentences to someone with no prior knowledge. Use simple language and examples.”</em></blockquote><h3>Template for Brainstorming</h3><blockquote><em>“Generate [number] ideas for [specific topic]. Include a short description for each.”</em></blockquote><p><strong>Example:</strong><br>“Generate 10 ideas for starting a small business with under $1,000. Include a short description for each.”</p><h3>Template for Writing Assistance</h3><blockquote><em>“Help me write a [type of writing] about [topic]. Make it [tone/style], and [specific instructions].”</em></blockquote><p><strong>Example:</strong><br>“Help me write a thank-you email to a client for their recent purchase. Make it professional and warm.”</p><h3>Why Prompt Engineering Matters</h3><p>AI tools are only as good as the instructions you give them. By mastering prompt engineering, you can save time, get better results, and unlock the full potential of AI. It’s not about knowing everything about technology; it’s about learning to ask the right questions.</p><p>Even if you’ve never used an AI tool before, start experimenting. Use the tips and templates in this guide to make your prompts clearer and more effective. You might be surprised by what you can achieve.</p><p>Ready to give it a try? Start with something simple like, “Plan a fun weekend itinerary in my city,” and see where it takes you!</p><p>AI is here to help — you just need to ask.</p><blockquote><strong><em>P.S.</em></strong></blockquote><blockquote><em>This story was written to 95% by ChatGPT. Here the prompt I used:</em></blockquote><blockquote>“<em>Write a Medium article about prompt engineering. Audience: mainly non-tech people that usually don’t use LLMs, perhaps because they don’t even think about it. Topics to include: what prompt engineering is, the 5 most important things and some examples. Also include templating and example templates.</em>”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5964ec8d3e84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Never use Excel as database]]></title>
            <link>https://fabiomotta98.medium.com/never-use-excel-as-database-f451284bd248?source=rss-1c67e0f21e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/f451284bd248</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[it]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Fabio Motta]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 14:45:36 GMT</pubDate>
            <atom:updated>2022-12-10T14:45:36.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lopb5d9zVwAe-Wr5" /><figcaption>Photo by <a href="https://unsplash.com/fr/@jankolar?utm_source=medium&amp;utm_medium=referral">Jan Antonin Kolar</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Excel can contain “<em>an organized collection of structured information, or data</em>” (databse definition taken from <a href="https://www.oracle.com/database/what-is-database/">Oracle</a>); so technically one could claim that Excel is a database (DB). However, if we use this definition, any kind of file could be a DB, even a word document…</p><p>Excel is a powerful spreadsheets tool that allows to work with data, not to store it! It is relatively easy and intuitive, can find it on most computers, and sufficient for most purposes. I understand the temptation to use it as a DB, but don’t! You won’t regret the decision.</p><p><strong>Data is among your company’s most valuable assets, treat it as such — never use Excel as your company’s DB</strong>.</p><h3>Problems with Excel when used as a DB</h3><p><strong>Data integrity</strong> is an issue as data gets too easily corrupted. Data types in cells are not enforced, could enter text where numbers should be. Most often data will be inserted/deleted/modified by manual entries. This includes inevitable human error that sooner or later will happen. Automatic and variable formatting can also corrupt data, e.g. date turned into number.</p><p><strong>Limited storage</strong> will soon become an issue as your project/company (hopefully) grows and consequentially the data you handle. Excel has a hard limit:1,048,576 rows by 16,384 columns. Also the single cells have limits; max column width: 255 characters (full list of limits <a href="https://support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3">here</a>).</p><p><strong>Not designed for multi-user</strong>. It happens often to work on a single spreadsheet with other people and send it around via email. This will inevitably lead to confusion with file versions, multiple people working on it synchronously (double work), and not being able to understand who changed what and when. Even if shared in the cloud there is the inevitable issue of collaborators overwriting each other’s work. Version history in the cloud is available, but tedious to reconstruct. Anybody can modify data and add/delete stuff. If access not managed properly, even anonymously! Recipe for disaster.</p><p><strong>Poor speed/performance</strong> as data increases and formulas become more complex. Sorting and filtering can also be problematic in Excel. DB much faster and simpler.</p><p><strong>Data security</strong> is not enforced by users and specific roles. Everybody can access and modify all data in an unstructured way — in a DB this is managed with users and roles. Something will go wrong, probably even accidentally. E.g. send email with spreadsheet to wrong person, accidentally delete a record, modify a function, or change the cell boundaries of it.</p><p><strong>Not supportive of complex tasks. </strong>Great for linear workflow and relative straightforward calculations. As the complexity increases, the tasks become hard with excel. VBA offers some automation, but it also has its limitations. Excel has no structures for indexing mechanism or relationship between records (offered by DBs).</p><p><strong>Tedious and time consuming.</strong> Often lots of copy paste involved or manual work to adapt/format the data. Waste of time and prone to errors.</p><p><strong>No matter the size of your company, Excel is not an acceptable DB option.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f451284bd248" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Dictionary: access values without knowing key names]]></title>
            <link>https://python.plainenglish.io/python-dictionary-access-values-without-knowing-key-names-e6f53d321e97?source=rss-1c67e0f21e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6f53d321e97</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Fabio Motta]]></dc:creator>
            <pubDate>Mon, 09 Nov 2020 14:25:05 GMT</pubDate>
            <atom:updated>2020-11-09T22:44:48.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pMaob-sTVrBLhMWv" /><figcaption>Photo by <a href="https://unsplash.com/@pisitheng?utm_source=medium&amp;utm_medium=referral">Pisit Heng</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A python dictionary is an unordered set of key:value pairs, in which the elements (values) are indexed by the keys — that have to be unique within a given dictionary. Accessing values of a Python dictionary when knowing the name of the matching keys is quite straightforward (example below). However, how do you do it without knowing the structure of the dictionary or/and not knowing the key names (e.g. incoming API messages)?</p><pre># access dict value <strong>with known key names</strong> <br># (keys are the ones in brackets: a, b, c, d. Matching values after # the &#39;:&#39;)</pre><pre>my_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3, &#39;d&#39;: 5}<br>print(my_dict[&#39;a&#39;]) </pre><pre>--- <br>output:<br>1</pre><p>If you are used to working with lists you might think about accessing the first element of the dictionary with <em>my_dict[0].</em> However, this will not return the first element (it will return an error).</p><p>If we do not know the exact key names we can first get these as a list and then use the list elements to access the values of the dictionary. Here an example:</p><pre># imagine that &#39;dict&#39; is an incoming dictionary which&#39;s key names we do not know</pre><pre># get key names as list:<br>keys = list(dict.keys())</pre><pre># now we can access the elements of the list &#39;keys&#39; containing all the keys of &#39;dict&#39;. Example:</pre><pre>first_value = dict[keys[0]]</pre><p>Attention! Do not to forget to convert the output of dict.keys() to the data type ‘list’! Otherwise it remains a ‘dict_keys’ object, which is not subscriptable and hence you will not be able to access the values stored in the variable ‘keys’ by indexing.</p><p>It is also possible to directly access the values with a similar method. Instead of the function ‘.keys()’ we can use the function ‘.values()’. This stores all the values of a dictionary in a list.</p><pre>values = list(dict.vaues())</pre><pre>first_value = values[0]</pre><p>Hope this short article helped and allows you to write more flexible code in which you do not have to change key names or get confused while using them!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6f53d321e97" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/python-dictionary-access-values-without-knowing-key-names-e6f53d321e97">Python Dictionary: access values without knowing key names</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python: if __name__ == “__main__”]]></title>
            <link>https://python.plainenglish.io/python-if-name-main-c6c4381d86c9?source=rss-1c67e0f21e34------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6c4381d86c9</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Fabio Motta]]></dc:creator>
            <pubDate>Thu, 18 Jun 2020 11:39:59 GMT</pubDate>
            <atom:updated>2020-06-21T20:48:17.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YZBIqBDG8qYU5nQ9" /><figcaption>Photo by <a href="https://unsplash.com/@davidclode?utm_source=medium&amp;utm_medium=referral">David Clode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you have been programming in Python for a bit it is probable you came across the code <em>if __name__ == “__main__” </em>and that you, like me and many others before, had no clue of what it means. Below a short explanation of how I understood it. Hope it helps!</p><p>The main function is essentially where any Python program starts. The Python interpreter (= program, which reads and executes code) sequentially reads the source file (= module) and executes the code. Remember, the <strong>main function can only be processed if the interpreter reads it as a Python program!</strong> Otherwise, it is ignored.</p><p>This is why the following code will not return anything:</p><pre><em>def main():<br>    print(2+2)</em></pre><p>It is seen as a module and hence skipped! Essentially, the function is just defined, and not yet called.</p><h3><strong>Solutions:</strong></h3><p>In Python 3 (or later) an easy solution would be to easily call the main function at the end of the code for the function:</p><pre><em>def main():<br>    print(2+2)<br>main()</em></pre><p>This calls the main function and executes the code.</p><p>Another solution is to call the code in the main function we want to run if the “special” variable (see below) <em>__name__ </em>is equal to <em>“__main__”</em>:</p><pre><em>def main():<br>    print(2+2)</em></pre><pre><em>if __name__ == “__main__”:<br>    main()</em></pre><p><strong>Why does this work? </strong>Before executing code, the Python interpreter reads the source file and defines a few “special” variables. The variable <em>__name__</em> is one of these and evaluates the name of the current module.</p><p>If the Python interpreter is running that module (the source file) as the main program, it sets the special __<em>name</em>__ variable to have a value “__<em>main</em>__”. <strong>The if statement allows checking whether a function is run from the current script or if it has been imported from another one.</strong></p><p>If it is imported from another module, __name__, will be set to that script’s name!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6c4381d86c9" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/python-if-name-main-c6c4381d86c9">Python: if __name__ == “__main__”</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>