<?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 Yasir ali on Medium]]></title>
        <description><![CDATA[Stories by Yasir ali on Medium]]></description>
        <link>https://medium.com/@yasirali179?source=rss-32fc1bcd3b20------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cOoNDTavBa49Qta3h9fGuQ.jpeg</url>
            <title>Stories by Yasir ali on Medium</title>
            <link>https://medium.com/@yasirali179?source=rss-32fc1bcd3b20------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 08:17:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yasirali179/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[Mastering Python Indexing: Unleash the Power of Position]]></title>
            <link>https://yasirali179.medium.com/mastering-python-indexing-unleash-the-power-of-position-fefc144a0ff2?source=rss-32fc1bcd3b20------2</link>
            <guid isPermaLink="false">https://medium.com/p/fefc144a0ff2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Yasir ali]]></dc:creator>
            <pubDate>Wed, 08 Nov 2023 12:50:04 GMT</pubDate>
            <atom:updated>2023-11-08T12:50:04.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4kwM_53Jqb1ADvmLFNMb2g.png" /></figure><p>Python, one of the most popular programming languages, is renowned for its simplicity and versatility. A crucial aspect of Python programming is indexing. Indexing allows you to access, manipulate, and slice data within various data structures like strings, lists, and tuples. In this article, we will explore the fundamentals of Python indexing, along with a plethora of code examples, including negative indexing.</p><h3>Table of content</h3><ol><li>What is Indexing?</li><li>Basic Indexing with Positive Numbers</li><li>Indexing with Negative Numbers</li><li>Slicing</li><li>Advanced Slicing with Negative Indexing</li><li>Stride in Slicing</li><li>Stepping Forward</li><li>Stepping Backward</li><li>Combining Positive and Negative Stepping</li><li>Conclusion</li></ol><h3>What is Indexing?</h3><p>Indexing is the process of accessing individual elements within a data structure, such as a string, list, or tuple, based on their position or index. In Python, indexing starts at 0 for the first element, and it can be both positive (starting from the beginning) and negative (starting from the end) to access elements.</p><h3>Basic Indexing with Positive Numbers</h3><p>Let’s start by understanding basic indexing with positive numbers using strings, lists, and tuples.</p><pre>text = &quot;Python&quot;<br>print(text[0])  # Output: &#39;P&#39;<br>print(text[2])  # Output: &#39;t&#39;<br><br><br>my_list = [10, 20, 30, 40, 50]<br>print(my_list[1])  # Output: 20<br>print(my_list[3])  # Output: 40<br><br><br>my_tuple = (1, 2, 3, 4, 5)<br>print(my_tuple[2])  # Output: 3<br>print(my_tuple[4])  # Output: 5</pre><h3>Negative Indexing</h3><p>Negative indexing allows you to access elements from the end of a data structure. The last element has an index of -1, the second-to-last element has an index of -2, and so on.</p><pre>text = &quot;Python&quot; <br>print(text[-1])  # Output: &#39;n&#39; <br>print(text[-3])  # Output: &#39;t&#39;<br><br><br>my_list = [10, 20, 30, 40, 50]<br>print(my_list[-1])  # Output: 50<br>print(my_list[-3])  # Output: 30<br><br><br>my_tuple = (1, 2, 3, 4, 5)<br>print(my_tuple[-1])  # Output: 5<br>print(my_tuple[-3])  # Output: 3</pre><blockquote>Note: In the above example, we can convert negative index to positive by subtracting length of list/string by its -ive index value.</blockquote><h3>Slicing</h3><p>Slicing allows you to extract a portion of a data structure. It uses two indices separated by a colon, where the first index is the starting point, and the second index is the ending point (exclusive).</p><pre>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>sublist = my_list[2:7]<br>print(sublist)  # Output: [3, 4, 5, 6, 7]</pre><h3>Advanced Slicing with Negative Indexing</h3><p>Slicing can be combined with negative indexing for more advanced operations.</p><pre>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>sublist = my_list[-4:-1]<br>print(sublist)  # Output: [7, 8, 9]</pre><p>Another Example</p><pre>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>sublist = my_list[1:9]<br>print(sublist)  # Output: [2, 3, 4, 5, 6, 7, 8, 9]</pre><h3>Advanced indexing with stepping</h3><p>Indexing in Python goes beyond basic access to elements; it also allows you to step through sequences, both forward and backward. In this article, we’ll delve into advanced indexing with stepping, covering both positive and negative indices, and demonstrate how this can be used to create powerful data manipulations.</p><h3>Stepping Forward</h3><p>When you want to access elements at regular intervals within a sequence, you can use stepping with positive indices.</p><pre>text = &quot;Python is awesome&quot;<br>result = text[0::2] # 0::2 means that we start from index 0 and move two positions at a time.<br>print(result)  # Output: &#39;Pto saeoe&#39;<br><br><br><br>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>result = my_list[1::3] # 1::3 starts from index 1 and moves three <br>                       # positions at a time.<br>print(result)  # Output: [2, 5, 8]</pre><h3>Stepping Backward</h3><p>Stepping can also be used to access elements in reverse order by using negative indices.</p><pre>text = &quot;Python is awesome&quot;<br>result = text[::-1]  # ::-1 starts from the end and moves backward one character at a time<br>print(result)  # Output: &#39;emosewa si nohtyP&#39;<br><br><br>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>result = my_list[::-2] # ::-2 starts from the end and moves backward two positions at a time.<br>print(result)  # Output: [10, 8, 6, 4, 2]</pre><h3>Combining Positive and Negative Stepping</h3><p>You can even combine positive and negative stepping for more complex sequences.</p><pre>text = &quot;Python is awesome&quot;<br>result = text[1:-1:3] <br>print(result)  # Output: &#39;ytsa&#39;</pre><p>In this example, 1:-1:3 starts from index 1, goes to the second-to-last element, and moves three positions at a time. Below is another emaple:</p><pre>my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>result = my_list[-1:2:-2]<br>print(result)  # Output: [10, 6, 2]</pre><p>Here, -1:2:-2 starts from the end, goes to index 2, and moves backward two positions at a time.</p><h3>Wrapping Up</h3><pre># Create a sample list<br>my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<br><br># Basic Slicing<br>basic_slice = my_list[2:7]<br>print(&quot;Basic Slicing:&quot;, basic_slice)  # Output: [2, 3, 4, 5, 6]<br><br># Negative Indexing and Slicing<br>negative_slice = my_list[-5:-2]<br>print(&quot;Negative Indexing and Slicing:&quot;, negative_slice)  # Output: [5, 6, 7]<br><br># Stepping Forward<br>forward_stepping = my_list[1::2]<br>print(&quot;Stepping Forward:&quot;, forward_stepping)  # Output: [1, 3, 5, 7, 9]<br><br># Stepping Backward<br>backward_stepping = my_list[-1::-2]<br>print(&quot;Stepping Backward:&quot;, backward_stepping)  # Output: [9, 7, 5, 3, 1]<br><br># Combining Positive and Negative Stepping<br>combined_stepping = my_list[-2:1:-2]<br>print(&quot;Combined Stepping:&quot;, combined_stepping)  # Output: [8, 6, 4]<br><br># Modify Elements Using Slicing<br>my_list[2:5] = [20, 30, 40]<br>print(&quot;Modified List:&quot;, my_list)  # Output: [0, 1, 20, 30, 40, 5, 6, 7, 8, 9]<br><br># Reverse the List Using Slicing<br>reversed_list = my_list[::-1]<br>print(&quot;Reversed List:&quot;, reversed_list)</pre><h3>Conclusion</h3><p>Python indexing is a fundamental concept that provides you with the ability to access and manipulate data within various data structures. Whether you’re working with strings, lists, or tuples, mastering indexing is essential for efficient data processing and manipulation in Python. Be sure to practice these examples and explore other applications of indexing to become proficient in its use. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fefc144a0ff2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Exception Handling: A Comprehensive Guide]]></title>
            <link>https://python.plainenglish.io/python-exception-handling-a-comprehensive-guide-049af14dbec7?source=rss-32fc1bcd3b20------2</link>
            <guid isPermaLink="false">https://medium.com/p/049af14dbec7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[exception-handling]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yasir ali]]></dc:creator>
            <pubDate>Mon, 06 Nov 2023 09:19:37 GMT</pubDate>
            <atom:updated>2023-11-10T04:26:22.559Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfHbuQxlb2beAodIIyNpjw.jpeg" /></figure><p>Exception handling is a crucial aspect of Python programming that allows developers to gracefully manage and recover from errors and unexpected situations in their code. By using Python’s exception handling mechanisms, you can write more robust and reliable applications. In this article, we’ll explore the fundamentals of Python exceptions and how to handle them effectively.</p><h3>What is an Exception?</h3><p>An exception is an unexpected event that occurs during the execution of a Python program and disrupts the normal flow of code. Exceptions can result from various issues, such as dividing by zero, attempting to access a non-existent file, or trying to access an element in a list that is out of bounds. When an exception occurs, it generates an error message and can cause the program to terminate if not properly handled.</p><h3>The try…except Block</h3><p>The primary tool for handling exceptions in Python is the try...except block. This construct allows you to isolate code that might raise an exception and provide a way to handle the error gracefully. Here&#39;s the basic structure of a try...except block:</p><pre>try:<br>    # Code that might raise an exception<br>except ExceptionType:<br>    # Code to handle the exception</pre><ul><li>The try block contains the code that you suspect may raise an exception.</li><li>The except block specifies the type of exception you want to handle and provides code to execute when that exception occurs.</li></ul><p>Let’s look at an example:</p><pre>try:<br>    x = 10 / 0  # This will raise a ZeroDivisionError<br>except ZeroDivisionError:<br>    print(&quot;Division by zero is not allowed.&quot;)</pre><p>In this case, the try block attempts to divide 10 by 0, which is not allowed in Python, leading to a ZeroDivisionError. The except block catches the error and prints a user-friendly message.</p><h3>Handling Multiple Exceptions</h3><p>You can handle multiple exceptions by including multiple except blocks for different exception types. Python will execute the first matching except block.</p><pre>try:<br>    value = int(&quot;abc&quot;)  # This will raise a ValueError<br>except ValueError:<br>    print(&quot;Invalid integer conversion&quot;)<br>except TypeError:<br>    print(&quot;Type error occurred&quot;)</pre><p>In this example, if an error occurs during the int(&quot;abc&quot;) conversion, the first except block will execute since it matches the ValueError exception.</p><h3>The else Block</h3><p>You can also use the else block in conjunction with a try...except statement. Code in the else block will run if no exception occurs in the try block.</p><pre>try:<br>    result = 10 / 2<br>except ZeroDivisionError:<br>    print(&quot;Division by zero is not allowed.&quot;)<br>else:<br>    print(f&quot;Result: {result}&quot;)</pre><p>Here, since the division operation doesn’t raise an exception, the code in the else block will execute.</p><h3>The finally Block</h3><p>The finally block is used to ensure that certain code is executed regardless of whether an exception occurs or not. It&#39;s commonly used for cleaning up resources, such as closing files or database connections.</p><pre>try:<br>    file = open(&quot;example.txt&quot;, &quot;r&quot;)<br>    # Perform file operations<br>except IOError:<br>    print(&quot;An error occurred while opening the file.&quot;)<br>finally:<br>    file.close()  # This will be executed no matter what</pre><p>In this example, even if an exception occurs while opening the file, the finally block ensures that the file is closed properly.</p><h3>Custom Exceptions</h3><p>Python allows you to create your own custom exceptions by defining a new class that inherits from the Exception class. This can be helpful when you want to raise specific, user-defined errors in your code.</p><pre>class CustomError(Exception):<br>    pass<br><br>try:<br>    raise CustomError(&quot;This is a custom exception&quot;)<br>except CustomError as e:<br>    print(f&quot;Custom error occurred: {e}&quot;)</pre><p>In this case, a CustomError is raised and caught in the except block.</p><h3>Conclusion</h3><p>Exception handling is a vital aspect of writing reliable and robust Python code. By using try...except blocks, you can gracefully manage errors and ensure that your program can recover from unexpected situations. Understanding how to use else and finally blocks, as well as creating custom exceptions, further enhances your ability to handle exceptions effectively in Python.</p><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, <a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li><li><em>Check out our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a>, <a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a>, <a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=049af14dbec7" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/python-exception-handling-a-comprehensive-guide-049af14dbec7">Python Exception Handling: A Comprehensive Guide</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[The Impact of Artificial Intelligence on Healthcare]]></title>
            <link>https://yasirali179.medium.com/the-impact-of-artificial-intelligence-on-healthcare-06950b8f0ca1?source=rss-32fc1bcd3b20------2</link>
            <guid isPermaLink="false">https://medium.com/p/06950b8f0ca1</guid>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Yasir ali]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 22:43:23 GMT</pubDate>
            <atom:updated>2023-11-02T22:43:23.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PN9iGCOOoWXwGlpj1vK7eg.jpeg" /></figure><p>Artificial Intelligence (AI) is revolutionising various industries, and one of the most transformative domains it’s shaping is healthcare. With the ability to analyse vast amounts of data, make predictions, and automate tasks, AI is providing new avenues for improving patient care, diagnosis, and treatment. In this article, we’ll explore the profound impact of AI on healthcare and its potential to reshape the future of medicine.</p><h3>Early Diagnosis and Disease Prediction</h3><p>One of the most significant contributions of AI to healthcare is its role in early disease diagnosis and prediction. Machine learning models can analyze patient data, including medical records, genetic information, and diagnostic images, to identify patterns and risk factors. This allows for the early detection of diseases like cancer, diabetes, and heart conditions. As a result, doctors can intervene at an earlier stage, significantly improving patient outcomes.</p><p>AI algorithms can also predict disease outbreaks and trends, helping healthcare authorities allocate resources and respond more effectively to public health emergencies.</p><h3>Personalized Treatment Plans</h3><p>AI is enabling the development of personalized treatment plans for patients. By considering an individual’s genetic makeup, medical history, and lifestyle, AI systems can recommend tailored treatment options. This approach not only increases treatment efficacy but also reduces the risk of adverse reactions to medications.</p><p>In some cases, AI-driven robots and devices can even perform complex surgeries with precision and minimal invasiveness. This minimizes patient recovery time and enhances surgical outcomes.</p><h3>Drug Discovery and Development</h3><p>The process of drug discovery is time-consuming and costly. AI is streamlining this process by analyzing vast datasets and simulating drug interactions. Machine learning models can predict how a potential drug compound will react within the human body, reducing the need for extensive laboratory testing. This accelerates the development of new drugs and treatments for various diseases.</p><h3>Administrative Efficiency</h3><p>Beyond clinical applications, AI is improving the administrative side of healthcare. AI-powered chatbots and virtual assistants are enhancing patient engagement by providing immediate responses to inquiries and scheduling appointments. This reduces the workload on healthcare staff, allowing them to focus on more complex tasks.</p><p>AI is also transforming medical billing and coding, reducing errors and ensuring accurate claims processing. The result is cost savings for healthcare providers and a more streamlined experience for patients.</p><h3>Challenges and Ethical Considerations</h3><p>While AI holds immense promise, it also comes with challenges and ethical considerations. Data privacy and security are critical concerns, especially when handling sensitive patient information. Ensuring that AI systems are ethically designed, transparent, and free from bias is essential to building trust with patients and healthcare professionals.</p><p>Additionally, the role of human healthcare providers remains paramount. AI can enhance decision-making, but it should complement, rather than replace, human expertise. The human touch in patient care is irreplaceable, and AI should serve as a tool to support healthcare professionals.</p><h3>The Future of Healthcare</h3><p>The integration of AI into healthcare is an ongoing journey. As technology continues to advance, we can expect even more significant breakthroughs in disease diagnosis, treatment, and prevention. With AI’s ability to analyze data at an unprecedented scale and speed, it has the potential to make healthcare more accessible, cost-effective, and patient-centric.</p><p>In conclusion, AI is reshaping the landscape of healthcare by enhancing early diagnosis, personalizing treatment plans, expediting drug discovery, and improving administrative efficiency. As we navigate the challenges and ethical considerations, AI will continue to be a driving force in the evolution of modern medicine, offering the promise of better healthcare outcomes for all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06950b8f0ca1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>