<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Katana Tran</title>
    <description>The latest articles on Forem by Katana Tran (@wildfire132).</description>
    <link>https://forem.com/wildfire132</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F217845%2F774d8e6e-f27a-49ab-b7ce-525882ff11c3.jpg</url>
      <title>Forem: Katana Tran</title>
      <link>https://forem.com/wildfire132</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wildfire132"/>
    <language>en</language>
    <item>
      <title>Material-UI Grid Breakpoints</title>
      <dc:creator>Katana Tran</dc:creator>
      <pubDate>Sat, 04 Jan 2020 20:11:43 +0000</pubDate>
      <link>https://forem.com/wildfire132/material-ui-grid-breakpoints-2dje</link>
      <guid>https://forem.com/wildfire132/material-ui-grid-breakpoints-2dje</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;This is a tutorial on how to set breakpoints for your Material UI grid.&lt;br&gt;
Breakpoints match with a certain screen width and depending on what value you set is how many cards will occupy the space given the amount of available space.  &lt;/p&gt;

&lt;p&gt;xs, extra-small: 0px&lt;br&gt;
sm, small: 600px&lt;br&gt;
md, medium: 960px&lt;br&gt;
lg, large: 1280px&lt;br&gt;
xl, extra-large: 1920px&lt;/p&gt;

&lt;p&gt;Here is a grid item from Material-UI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Grid&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="nx"&gt;xs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;A&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;sm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;B&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;md&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;C&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;lg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;D&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;xl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;E&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Paper&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;classes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;paper&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;My&lt;/span&gt; &lt;span class="nx"&gt;Grid&lt;/span&gt; &lt;span class="nx"&gt;Item&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Paper&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Grid&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Material-UI's grid is based on a 12 column system meaning the screen at any given point has 12 columns of available space. When you change a value at ABCDE it will tell the item, "Hey, let's take up X amount of columns with this one grid item at this breakpoint!" This allows us to set up the grid in so many unique ways based on how we set the values for each breakpoint. Below I will list out some examples and their output!&lt;/p&gt;

&lt;p&gt;Here is a sandbox provided by Material-UI that you can play along in! &lt;a href="https://codesandbox.io/s/l8z4m"&gt;Grid Sandbox&lt;/a&gt; (Remember to navigate to demo.js to change the values of the grid items.)&lt;/p&gt;

&lt;h1&gt;
  
  
  Examples
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c0i5X0sT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1qtm3v7e59yf3fxk3e40.png" class="article-body-image-wrapper"&gt;&lt;img width="700" height="500" src="https://res.cloudinary.com/practicaldev/image/fetch/s--c0i5X0sT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1qtm3v7e59yf3fxk3e40.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the above example we have the first row which is a grid item - xs(12) meaning it will always take all 12 of the columns at any screen size. &lt;/li&gt;
&lt;li&gt;The second row has two grid items - xs(12), sm(6) meaning at screen size small and larger (width: 600px+) each card will take up half the screen (2 cards x 6 columns each = 12 columns total) and at size x-small (width:0-600px) the card will take 12 columns, or the full screen.&lt;/li&gt;
&lt;li&gt;The third row has 4 grid items - xs(6), sm(3) meaning at screen size small and larger (width: 600px+) each card will take up 1/4th of the screen (4 cards x 3 columns each = 12 columns total) and at size x-small (width:0-600px) the card will take 6 columns, or half the screen. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; Even if you decrease the width of the grid in the above image, the third row will never only have 1 card in it, because it is programmed to always have 2 cards for an x-small screen. An example of compressing the width to a super small screen is below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rtyEx1ex--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kfheywo0bo7e32nr5l52.png" class="article-body-image-wrapper"&gt;&lt;img width="400" height="400" src="https://res.cloudinary.com/practicaldev/image/fetch/s--rtyEx1ex--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kfheywo0bo7e32nr5l52.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You also do not need to have the 12 columns equally distributed between the cards in the row. If you had a grid item - xs(12), sm(9) and another grid item - xs(12), sm(3), they will be able to share the same row and take up 9 columns and 3 columns respectively, here is an image of this below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M93AWGDe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jiee02m78a07lojy5lie.png" class="article-body-image-wrapper"&gt;&lt;img width="700" height="400" src="https://res.cloudinary.com/practicaldev/image/fetch/s--M93AWGDe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jiee02m78a07lojy5lie.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take note, if you distribute your cards without adding to 12 columns, the cards will not full take up the row and you'll be left with some extra space on the right-hand side like below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rD8lu9Lj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cxbahidciaya4vbwv2me.png" class="article-body-image-wrapper"&gt;&lt;img width="700" height="400" src="https://res.cloudinary.com/practicaldev/image/fetch/s--rD8lu9Lj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cxbahidciaya4vbwv2me.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Author's Note: Thanks for reading, guys! I had a hard time find a good resource to learn how to create this grid and the explanation on Material-UI wasn't enough for me so after playing around on the sandbox I created my own tutorial! Enjoy! &lt;/i&gt;&lt;/p&gt;

</description>
      <category>materialui</category>
      <category>breakpoints</category>
      <category>grid</category>
    </item>
    <item>
      <title>Using EmailJS and React to send Support Emails</title>
      <dc:creator>Katana Tran</dc:creator>
      <pubDate>Mon, 30 Dec 2019 07:49:37 +0000</pubDate>
      <link>https://forem.com/wildfire132/using-emailjs-and-react-to-send-support-emails-314i</link>
      <guid>https://forem.com/wildfire132/using-emailjs-and-react-to-send-support-emails-314i</guid>
      <description>&lt;h1&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/h1&gt;

&lt;p&gt;You know those forms which send a support request to the site's support team? Well we are creating them today for our website! This tutorial assumes an understanding of using React to create forms, changing component state, and submission of forms. &lt;/p&gt;

&lt;p&gt;We will be using &lt;a href="https://www.emailjs.com" rel="noopener noreferrer"&gt;EmailJS's service&lt;/a&gt;. Here is also the &lt;a href="https://www.npmjs.com/package/emailjs-com" rel="noopener noreferrer"&gt;link to the package&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;&lt;b&gt;Tutorial&lt;/b&gt;&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Start by installing EmailJS with npm 
&lt;code&gt;$ npm install emailjs-com --save&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sign up with EmailJS. Use an email you would like to receive support emails at. &lt;/li&gt;
&lt;li&gt;&lt;p&gt;After signing up, click the email service you would like, I chose Gmail to get started. You can remember this service ID to use later to send your form, otherwise if you have only one service, it will default to it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's grab our API key at this time. In EmailJS, navigate to Account &amp;gt; API keys &amp;gt; then copy the user ID to a notepad for later use.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9vigz7rmku994essb9o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9vigz7rmku994essb9o2.png" alt="api-key-img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a template on EmailJS, this can be any written notice you want. Replace any fields that will be filled by your form submission with &lt;code&gt;{{}}&lt;/code&gt; double curly braces. Within the braces will be the key in the key-value pair of your component's state.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F76ojrb4kuh4b9nq37fyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F76ojrb4kuh4b9nq37fyf.png" alt="email-template"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Import EmailJS into your form's page with &lt;code&gt;import emailjs from 'emailjs-com';&lt;/code&gt; then create your form with React and store the form outputs in your state with matched keys from your template. You can find this by clicking EmailJS &amp;gt; Email Templates &amp;gt; Example Email Template (or whichever template you're using) &amp;gt; Copy Code on right hand corner. Lets also write down the template ID while we are looking at this page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5ahqsaafymuk57u8vc44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5ahqsaafymuk57u8vc44.png" alt="verification-img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If done correctly then all we need to do is write a bit of code for the submission of the form, I have an onclick on the button at the end of the form which submits this to the email service. Here is the block of code which needs to go into the submit function:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;emailjs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;YOUR SERVICE ID&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;YOUR TEMPLATE ID&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;YOUR PARAMS&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;YOUR USER ID&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SUCCESS!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;FAILED...&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For your service ID, you can use 'default_service' or the ID of a service you created, for template ID put in the one you found while cross-checking the template parameters, your params can simply be the state of your React component, and user ID is the API key &amp;gt; User ID you can find under account!&lt;/p&gt;

&lt;h1&gt;
  
  
  Results
&lt;/h1&gt;

&lt;p&gt;The resulting code with the template params matched up, correct template key, service ID, and your user API key inserted: (Remember to import emailjs into this component!)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq0rzj7168chfl79v9e3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq0rzj7168chfl79v9e3b.png" alt="react-form"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is my form with the filled out fields, on submit it will send the form to the designated email.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fb64997codxzpb5t6zi2d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fb64997codxzpb5t6zi2d.png" alt="filled-form"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, tada! You've got yourself an email! You can then reply to the email supplied by your form and template with your business email address. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmdxq0l45xy39emipxe8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmdxq0l45xy39emipxe8u.png" alt="finished-email"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>emails</category>
      <category>emailjs</category>
      <category>react</category>
      <category>support</category>
    </item>
    <item>
      <title>Learning a bit about Python: A quicker way to slice </title>
      <dc:creator>Katana Tran</dc:creator>
      <pubDate>Mon, 09 Dec 2019 01:26:08 +0000</pubDate>
      <link>https://forem.com/wildfire132/learning-a-bit-about-python-a-quicker-way-to-slice-2bba</link>
      <guid>https://forem.com/wildfire132/learning-a-bit-about-python-a-quicker-way-to-slice-2bba</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;I recently started learning Python as an alternative to using Javascript for coding algorithms. What I noticed is Python had a different toolkit than I was used to in Ruby and JS, particularly for array/list methods. &lt;/p&gt;

&lt;p&gt;Here are a few tricks I've learned and hopefully they'll be helpful to you too!&lt;/p&gt;

&lt;h3&gt;
  
  
  Descriptions
&lt;/h3&gt;

&lt;p&gt;Lists: Lists are akin to arrays, they follow the square bracket notation and are mutable.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;list = [1,2,3,4,5]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Tuples: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tuples take the same structure as lists but are immutable, this means they cannot be changed to represent a new value after creation. &lt;/li&gt;
&lt;li&gt;Tuples are represented by parentheses.&lt;/li&gt;
&lt;li&gt;They make debugging easier, since you know the information will remain unchanged through a tuple, you can mitigate tracking of past edits.&lt;/li&gt;
&lt;li&gt;Modification of tuples can work such as iterating and adding extra indices to the tuple, but this requires a longer run time than if you used a list since the tuple must be remade each iteration and the old ones destroyed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;tuple = (1,2,3,4,5)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Methods to use
&lt;/h3&gt;

&lt;p&gt;Think about the times you had to do the following. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reversing a list?&lt;/li&gt;
&lt;li&gt;Slicing a list?&lt;/li&gt;
&lt;li&gt;Grab only even or odd numbers from an array?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python allows us a great tool to better grab such information from a list, tuple, or even a string! &lt;/p&gt;

&lt;p&gt;&lt;b&gt; object[start:stop:step]&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;What you want to slice can be sliced with this simple format. Pick what index to start, which to stop (not including this index), and how many steps in between new indexes. If you leave the start empty, it will start at the beginning of the array, leave the stop empty, it'll end at the end of the array. Step is automatically 1 unless otherwise specified.&lt;/p&gt;

&lt;p&gt;Imagine a string and a list&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bob = "Bob loves bananas!"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;numbers = [1,2,3,4,5,6,7,8,9,10]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This would be how to use the above tool to gather what I need in each scenario: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I only want bob's name:

&lt;code&gt;bob[:3]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;I want to reverse the numbers:

&lt;code&gt;numbers[::-1]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;I also want to reverse what bob loves:
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;bobloves = bob[-8:-1] &lt;br&gt;
bobloves[::-1]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I only want odd numbers:

&lt;code&gt;numbers[::2]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;I want a slice of numbers from 1-9:

&lt;code&gt;numbers[:-1]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;I want a slice of numbers from 5-10:

&lt;code&gt;numbers[4:]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;I want a slice of numbers from 2-9:

&lt;code&gt;numbers[1:-1]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is much quicker for me than creating a new slice object in Python then applying that to the array I need to slice. (This can be great for other reasons of course.)&lt;/p&gt;

&lt;p&gt;This was my first Dev.to post and I am excited to continue sharing with the community and learning more from everyone!&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
