<?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>DEV Community: Fares Zaidi</title>
    <description>The latest articles on DEV Community by Fares Zaidi (@fares_zaidi).</description>
    <link>https://dev.to/fares_zaidi</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%2F3740848%2F25683ccc-4627-444a-b0d3-a579100e0151.png</url>
      <title>DEV Community: Fares Zaidi</title>
      <link>https://dev.to/fares_zaidi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fares_zaidi"/>
    <language>en</language>
    <item>
      <title>Week One: The Basics of Python, Data Types, Variables, Numbers</title>
      <dc:creator>Fares Zaidi</dc:creator>
      <pubDate>Fri, 06 Feb 2026 14:57:27 +0000</pubDate>
      <link>https://dev.to/fares_zaidi/week-one-the-basics-of-python-data-types-variables-numbers-2i53</link>
      <guid>https://dev.to/fares_zaidi/week-one-the-basics-of-python-data-types-variables-numbers-2i53</guid>
      <description>&lt;h2&gt;
  
  
  Week One: The Basics of Python, Data Types, Variables, Numbers
&lt;/h2&gt;




&lt;h2&gt;
  
  
  Data Types and Variables in Python:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Variables:
&lt;/h2&gt;

&lt;p&gt;Variables are like labeled boxes to store different types of data in them. You can call the data by simply calling the label of that box, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;my_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Fares&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example, we created two boxes labeled &lt;code&gt;my_name&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt;, each one of them stores a value (Fares, 19). I can use them in my program by calling the variable of that value; for example, using the &lt;code&gt;print()&lt;/code&gt; function (we will talk more about functions later), we can print the data assigned to those variables&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;my_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Fares&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Output: Fares
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Output: 19
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rules of Naming a Variable:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Only start with a letter or underscore ( _ )&lt;/li&gt;
&lt;li&gt;only contain alphanumeric characters and underscores &lt;/li&gt;
&lt;li&gt;variables names are case sensitive; 'age' and 'Age' are different&lt;/li&gt;
&lt;li&gt;cannot be one of Python's reserved keywords, e.g., 'if,' 'class,' or 'def'
### &lt;strong&gt;&lt;em&gt;Tip: Naming conventions to follow :&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Use lowercase, with separate words separated by an underscore
example :
my_variable_name = 'Fares is the best programmer.'&lt;/li&gt;
&lt;li&gt;Use descriptive names to better communicate with team members or your future self; use user_age to name a variable instead of 'age' or 'ua.'&lt;/li&gt;
&lt;li&gt;Avoid using single-letter variable names.
## Data Types in Python: &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strings:&lt;/strong&gt; A sequence of characters enclosed in single or double quotation marks, like &lt;code&gt;'Hello world!'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integer:&lt;/strong&gt; A whole number without decimals, for example, &lt;code&gt;10&lt;/code&gt; or &lt;code&gt;-5&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Float:&lt;/strong&gt; A number with a decimal point, like &lt;code&gt;4.41&lt;/code&gt; or &lt;code&gt;-0.4&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Boolean&lt;/strong&gt;: A true or false type, written as &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set&lt;/strong&gt;: An unordered collection of unique elements, like &lt;code&gt;{4, 2, 0}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dictionary&lt;/strong&gt;: A collection of key-value pairs enclosed in curly braces, like &lt;code&gt;{'name': 'John Doe', 'age': 28}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuple&lt;/strong&gt;: An immutable ordered collection, enclosed in brackets, like &lt;code&gt;(7, 8, 4)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Range&lt;/strong&gt;: A sequence of numbers, often used in loops, for example, &lt;code&gt;range(5)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;List&lt;/strong&gt;: An ordered collection of elements that supports different data types.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;None&lt;/strong&gt;: A special value that represents the absence of a value.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;To get the data type of a variable, you can use the &lt;code&gt;type()&lt;/code&gt; function:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;immutable:&lt;/strong&gt; Immutable means it &lt;strong&gt;cannot be changed after it is created&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt; A function is a named block of code that runs when called.&lt;/p&gt;
&lt;h2&gt;
  
  
  It takes inputs, does work, and can return a result.
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Strings:
&lt;/h2&gt;

&lt;p&gt;A string is a mix of characters written between two double quotation marks or two single quotation mark.&lt;br&gt;
In some languages &lt;code&gt;'hello fares'&lt;/code&gt; and &lt;code&gt;"hello fares"&lt;/code&gt; are treated differently, but not in python&lt;br&gt;
If you have a multiple-line string, you can use three double or single quotation marks.&lt;br&gt;
e.g :&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;long_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt; multiple
line
string &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="n"&gt;long_str_2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'''&lt;/span&gt;&lt;span class="s"&gt; another
long
string &lt;/span&gt;&lt;span class="sh"&gt;'''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your string contains either single or double quotation marks, then you have two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the opposite kind of quotes. That is, if your string contains single quotes, use double quotes to wrap the string, and vice versa:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;It&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s a sunny day&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;She said, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World!&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Escape the single or double quotation mark in the string with a backslash (&lt;code&gt;\&lt;/code&gt;). With this method, you can use either single or double quotation marks to wrap the string itself:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;It&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s"&gt;s a sunny day&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;She said, &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;Hello!&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;sometimes if you have a really long string and you wander if their is a specific character or a word in that string, python have this really cool operator called &lt;code&gt;in&lt;/code&gt; to find a character or a word in the string, e.g :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# write a very long paragraph 
&lt;/span&gt;&lt;span class="n"&gt;me&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt; this is a very long paragraph to explain the way to write a long string and search for a specific character or a word by using the operator &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;in&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="c1"&gt;# see if that string have 'python' in it
&lt;/span&gt;&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;python&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;fares&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  - There is different types of operations to do in string, we will talk about those more deeply in the future.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Numeric Data
&lt;/h2&gt;

&lt;h2&gt;
  
  
  integers:
&lt;/h2&gt;

&lt;p&gt;integers are whole numbers, no decimal points, and can be positive or negative.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;

&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# int
&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# int
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;we used the &lt;code&gt;type()&lt;/code&gt; function we talked about before.
### Operations to do on integers
#### Addition &lt;code&gt;+&lt;/code&gt;
Adds two integers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;  &lt;span class="c1"&gt;# 68
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Subtraction &lt;code&gt;-&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Subtracts one integer from another.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;  &lt;span class="c1"&gt;# 44
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Multiplication &lt;code&gt;*&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Multiplies integers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;  &lt;span class="c1"&gt;# 48
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Division &lt;code&gt;/&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Divides integers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;  &lt;span class="c1"&gt;# 4.666666666666667
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Important
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Dividing integers with &lt;code&gt;/&lt;/code&gt; &lt;strong&gt;always returns a float&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;int / int → float&lt;/code&gt;
## Floats:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Floats&lt;/strong&gt; are numbers that contain a decimal point&lt;/li&gt;
&lt;li&gt;They can be positive or negative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;code&gt;3.14&lt;/code&gt;, &lt;code&gt;-0.5&lt;/code&gt;, &lt;code&gt;0.0&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;4.9&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;12.0&lt;/span&gt;

&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# float
&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# float
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic Operations with Floats
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Addition (&lt;code&gt;+&lt;/code&gt;)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mf"&gt;5.4&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt;  &lt;span class="c1"&gt;# 17.4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Subtraction (&lt;code&gt;-&lt;/code&gt;)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;  &lt;span class="c1"&gt;# 6.6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Multiplication (&lt;code&gt;*&lt;/code&gt;)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;  &lt;span class="c1"&gt;# 64.80000000000001
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Long decimal values happen because floats are stored approximately in memory&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Division (&lt;code&gt;/&lt;/code&gt;)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mf"&gt;12.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;  &lt;span class="c1"&gt;# 2.222222222222222
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Mixing &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When an &lt;strong&gt;int&lt;/strong&gt; and a &lt;strong&gt;float&lt;/strong&gt; are used together, Python converts the result to a &lt;strong&gt;float&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;  &lt;span class="c1"&gt;# 61.4
&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# float
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This applies to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Addition&lt;/li&gt;
&lt;li&gt;Subtraction&lt;/li&gt;
&lt;li&gt;Multiplication&lt;/li&gt;
&lt;li&gt;Division&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt;  &lt;/p&gt;

&lt;h2&gt;
  
  
  If a float is involved, the result is a float.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  How Does the Print Function Work?
&lt;/h2&gt;

&lt;p&gt;every language has it's own way to print output into the terminal, in python we use the function print().&lt;br&gt;
to print the sentence "Hello, fares" we put "Hello, fares" inside the print function, we use (" ") to tell python that this is a string.&lt;br&gt;
a string is a sequence of characters surrounded by either single (&lt;code&gt;'&lt;/code&gt;) or double (&lt;code&gt;"&lt;/code&gt;) quotation marks.&lt;br&gt;
In the &lt;code&gt;python print('Hello fares!')&lt;/code&gt;  example, the string &lt;code&gt;'Hello fares!'&lt;/code&gt; is an &lt;strong&gt;argument&lt;/strong&gt; passed to the &lt;code&gt;print&lt;/code&gt; function. You can also use the &lt;code&gt;print&lt;/code&gt; function to show multiple values, or arguments, at once by separating them with commas.&lt;br&gt;
Python automatically adds a space between each item when you separate them with commas.&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Beginner Practice Task: Data Types, Variables, Strings, Numbers
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;Practice creating variables, using basic data types, and combining strings with numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules
&lt;/h2&gt;

&lt;p&gt;Use only:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;variables&lt;/li&gt;
&lt;li&gt;strings&lt;/li&gt;
&lt;li&gt;integers and floats&lt;/li&gt;
&lt;li&gt;basic arithmetic (&lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Task Description
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create the following variables:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;name&lt;/code&gt; → a string with your name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;age&lt;/code&gt; → an integer&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;height&lt;/code&gt; → a float (meters)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;favorite_number&lt;/code&gt; → an integer&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Create new variables using the previous ones:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;age_next_year&lt;/code&gt; → age + 1&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;height_cm&lt;/code&gt; → height multiplied by 100&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Print the following sentences exactly using variables

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;My name is &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;I am &amp;lt;age&amp;gt; years old&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Next year I will be &amp;lt;age_next_year&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;My height is &amp;lt;height_cm&amp;gt; cm&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;My favorite number doubled is &amp;lt;favorite_number * 2&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Expected Practice Focus
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Knowing when to use &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt;, and &lt;code&gt;str&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Assigning values to variables&lt;/li&gt;
&lt;li&gt;Performing simple calculations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - Printing readable text using variables
&lt;/h2&gt;

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