<?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: lordronjuyal</title>
    <description>The latest articles on DEV Community by lordronjuyal (@lordronjuyal).</description>
    <link>https://dev.to/lordronjuyal</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%2F1446569%2Fc4185d7b-56d7-48c5-8b9b-eba70d8d3fc8.png</url>
      <title>DEV Community: lordronjuyal</title>
      <link>https://dev.to/lordronjuyal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lordronjuyal"/>
    <language>en</language>
    <item>
      <title>day 09</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Tue, 28 May 2024 06:30:40 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-09-1gl6</link>
      <guid>https://dev.to/lordronjuyal/day-09-1gl6</guid>
      <description>&lt;p&gt;date:- 28 May, 2024.&lt;/p&gt;

&lt;p&gt;Procedural programming:- This is just how we structure our code. This is an old way of coding. In this, we divide our program into the logical sequence of steps it needs to follow to do the task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object-oriented programming&lt;/strong&gt;:- This is another and more modern way of structuring the code. In this, we divide programs into different groups called object, where each object is responsible for a specific job. By this, we try to model objects as real-world entities. They can have their own attributes(properties/variables) and methods(functions).&lt;/p&gt;

&lt;p&gt;In OOP, we create a standard description(properties and methods) of a group. This is called class. This class is used to make other objects which have the same description and some additional properties and methods. For eg we make a teacher as a class, knowledge of a subject can be its properties and functions including teaching, homework, test etc. Now, object will be real life people like Ramesh sir, Asha madam who will have knowledge and functions like teaching, giving homework etc plus additional functions/properties like storytelling, name which can be unique. &lt;br&gt;
To make an object from class: object_name = ClassName()&lt;br&gt;
We use Pascal case(each letter capital) for class names and we have to use ().&lt;br&gt;
Now object_name is the object we created and it will get attributes and methods of the "ClassName" class. To access attributes or functions, we use object_name.attribute_name or object_name.function_name()&lt;/p&gt;

&lt;p&gt;Other things I learned today:- &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To use a global variable in local scope, we have to use code global variable_name. But in the case of dictionaries, we don't have to write this.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Project I made:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Coffe machine
&lt;a href="https://replit.com/@rohitrj332024/Coffee-machine-day-09#main.py"&gt;https://replit.com/@rohitrj332024/Coffee-machine-day-09#main.py&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Somehow theory took much of my time. I am practicing oop with turtle module. Time for the rest. Thank you see you tomorrow.&lt;/p&gt;

</description>
      <category>python</category>
      <category>oop</category>
      <category>newbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>day 08</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Mon, 27 May 2024 06:21:21 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-08-21l</link>
      <guid>https://dev.to/lordronjuyal/day-08-21l</guid>
      <description>&lt;p&gt;date: 27 May, 2024.&lt;/p&gt;

&lt;p&gt;Scope -- Everything we create of define in code is called namespace eg variables, functions, lists, etc. This namespace can be used or accessed in a region of code. This region is called scope of that namespace.&lt;br&gt;
We have two scopes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Global scope -- This is scope of top-level code(top level means it's not inside any functions). We can access it anywhere in the code, but we can't change its value inside a function. This scope is good for constant variables.&lt;/li&gt;
&lt;li&gt;Local scope -- namespace inside a function has local scope. We can only access this namescape inside the function not outside of it.
Now if we use same name inside a global scope and local scope, both will create two different namespaces. If we want to access and change a global namespace inside local, we have to use-- global name_of_namespace.
Now we can use and change its value also, though doing this is not a good practice.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Other things I learned today--&amp;gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;using _ when looping over and not using the item.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;list1=[a,b]&lt;br&gt;
list2=[1,2]&lt;br&gt;
list1.expand(list2)  &amp;gt;&amp;gt; list1 = [a,b,1,2]&lt;br&gt;
list1 += list2  #will give same result&lt;br&gt;
.append is used for adding single item&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We should all capital letters for a variable having contact value, eg PI= 3.14. This is used as the standard reference, it won't give any error if we deviate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to import multiple functions from module:&lt;br&gt;
from module import f1 , f2&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Programs I created:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Guess the number&lt;br&gt;
&lt;a href="https://replit.com/@rohitrj332024/guess-the-number-day-8#main.py"&gt;https://replit.com/@rohitrj332024/guess-the-number-day-8#main.py&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Guess higher or lower followers(Instagram)&lt;br&gt;
&lt;a href="https://replit.com/@rohitrj332024/higher-lower-start-day8"&gt;https://replit.com/@rohitrj332024/higher-lower-start-day8&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Personal -- I am happy that I am able to solve these problems. They are taking time, and I am also following proper procedures for solving them, like writing steps to do (breaking the problem into small parts), and making a flow chart( I make them on paper right now). I hope I will be able to build a good habit and it will help me when solving bigger projects later on. &lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>day 7</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Sun, 26 May 2024 10:30:14 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-7-1eb5</link>
      <guid>https://dev.to/lordronjuyal/day-7-1eb5</guid>
      <description>&lt;p&gt;date: 26 May, 2024.&lt;br&gt;
Importing from module:- To import a module(file) in our code we use: import module_name. But this may increase the size of our file. If we want only one method from the module we can use: from module import function_name. It will only import that function from the module file.&lt;/p&gt;

&lt;p&gt;Other things I learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;from os import system -- If we require to clear the console screen when the program is running we can import this and use: system("clear")&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docstring -- We can create documentation of our user-defined function using this. Just after the first line of function definition[def func_name():], use multiple line string("""... """") to write what function does, variables it can take, etc. Now whenever we call this function the user can see this comment on hovering over that function call.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can use dictionary to store function names. &lt;br&gt;
eg def func1: &lt;br&gt;
.....&lt;br&gt;
def func2: &lt;br&gt;
.....&lt;br&gt;
dic= { key1 : func1,   #no () so it won't call the function&lt;br&gt;
....&lt;br&gt;
variable1=dic[key1] &lt;br&gt;
this will copy the function into variable1 and we can use &lt;br&gt;
variable1() &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Recursion - this is a process in which function keeps on calling itself and the process continues. It is just like a while loop. So we need to have a termination condition in it. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;for index, item in enumerate(list): &lt;br&gt;
Above is the for loop by which we can get the item and their index value in the list. Otherwise, we have to use another variable =0 and +1 in each iteration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can't call a function before we define it. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Program I made: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Auction app - using dictionary&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff321xt0zz6oxx1hxy0hp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff321xt0zz6oxx1hxy0hp.png" alt="auction app using dictionary" width="749" height="522"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calculator app&lt;br&gt;
&lt;a href="https://replit.com/@rohitrj332024/Calculator#main.py"&gt;https://replit.com/@rohitrj332024/Calculator#main.py&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blackjack -This took much of my time. But I am happy I completed it without watching the tutorial. Code may not be proper but I tried my best to use functions and comments to help myself in future. Making flowchart in advance and breaking program into smaller problems helped me a lot. I hope with practice I will improve more.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://replit.com/@rohitrj332024/blackjack-day-7#main.py"&gt;https://replit.com/@rohitrj332024/blackjack-day-7#main.py&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Personal --&amp;gt; Coding the project took much of my time. I wanted to jump fast but I think consistency matters more. I am happy that I was able to code a game though my code may be messy or unprofessional, but coding it gave me great satisfaction. Now my brain needs some rest. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>day 06</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Sat, 25 May 2024 07:03:50 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-06-1p96</link>
      <guid>https://dev.to/lordronjuyal/day-06-1p96</guid>
      <description>&lt;p&gt;date:- 25 May, 2024.&lt;/p&gt;

&lt;p&gt;Function:- We can pass data into the function and can then use it there. To use this we have to define function parameters (variables especially for that function). Syntax is- def func_name( parameter1, parameter2):&lt;br&gt;
Now we have to call the function and pass value, syntax for that is- func_name( argument1, argument2)&lt;br&gt;
Order is important here. Parameter is the name of the variable and arguments are the values. We can also specify which argument to which parameter at the time of calling the function.&lt;br&gt;
 eg func_name(parameter2=argument2, parameter1=argument1):&lt;br&gt;
Order in this case doesn't matter.&lt;/p&gt;

&lt;p&gt;Dictionary:- It's a data structure in which we store data in key-value pairs. Each key needs to be unique. Value can be another data structure.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Syntax- dic = {key1 : value1 , key2 : value2, }&lt;br&gt;
empty dic = {}  # same thing can be used to clear a dictionary&lt;br&gt;
to access a value- dic[key]   # we need to know key&lt;br&gt;
to add a key or change previous key's value- dic[key]=value&lt;br&gt;
to delete a key- del dic[key]&lt;br&gt;
to loop- 1) for key in dic:&lt;br&gt;
2) for key, value in dic.items(): &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Functions I learned:- &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;math.ceil(x) - this will return the smallest integer greater than or equal to x. eg it will change 5.2 t0 6. round will return 5 in this case. We have to import math module for this.&lt;/li&gt;
&lt;li&gt;math.sqrt(x) - it will return square root of x.&lt;/li&gt;
&lt;li&gt;sum(list) - Gives sum of the list, provided all items are numbers.&lt;/li&gt;
&lt;li&gt;list.index(item) - This will return the index(base 0) of the item if present in the list. It will only return the index of the first item it will find from the left if multiple are present. Also, if the item is not found it will cause an error, so better check with - if item in list: in the first place.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Programs I made:&lt;br&gt;
1)  Prime number checker (between 1 to 100): &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F966p0xcl5budwmcsjfxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F966p0xcl5budwmcsjfxm.png" alt="Prime number checker" width="580" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>day 05</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Fri, 24 May 2024 12:13:15 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-05-i21</link>
      <guid>https://dev.to/lordronjuyal/day-05-i21</guid>
      <description>&lt;p&gt;date: 24 May, 2024.&lt;/p&gt;

&lt;p&gt;False values:- When we use bool() function to convert other data types, it does the conversion on the basis of these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Number 0 and all empty data structures like empty string "", will turn into False&lt;/li&gt;
&lt;li&gt;Numbers other than 0 and non-empty data structures will  turn into True&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Logical operator: There are 3 operators we use in Python, for combining different values.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;and -- This returns the first false value it encounters, if not it will return the last value.&lt;br&gt;
eg a = True and 23 and "" and 0 and 15&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;a = ""&lt;br&gt;
a = True and 23&lt;br&gt;
a = 23&lt;br&gt;
If we use this in conditional statements, these will auto-convert using the bool function in the background and we will get a boolean value. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;or  -- This returns the first True value it encounters, if not it will return the last value.&lt;br&gt;
eg a = True or 23 and "" or 0 or 15&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;a = True&lt;br&gt;
a = 0 and 23&lt;br&gt;
a = 0&lt;br&gt;
Like 'and', it gets converted into boolean values in conditional statements.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;not -- Unline 'and' (or) 'or' it will return the boolean values (True or False) opposite the value it's given&lt;br&gt;
eg not True  &amp;gt;&amp;gt;False&lt;br&gt;
not False  &amp;gt;&amp;gt; True&lt;br&gt;
not 0  &amp;gt;&amp;gt;True&lt;br&gt;
not "ABC" &amp;gt;&amp;gt;False&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Loops&lt;/strong&gt;:- Another type of control statement is loops, where we can execute a code block multiple times till a condition is satisfied or a timer runs. Iteration is another name for this process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For&lt;/strong&gt; loop:- We can iterate over a code in two ways&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;using list -- for item in list:
This will iterate for each item in the list and we can use that item in our code.&lt;/li&gt;
&lt;li&gt;using range -- for x in range( a, b, step):
The range function will create a range starting from a and ending 1 step before b. step is the gap we wanted to be added to each iteration in a. If step is not passed, it will take it as 1. Finally, if only 1 number is passed, the loop will start from 0 to b-1.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;while&lt;/strong&gt; loop:- Syntax for it- while condition:&lt;br&gt;
It will iterate till the condition is true. We need to have a termination condition or logic in this, or else it will run infinitely and crash the interpreter. &lt;/p&gt;

&lt;p&gt;Functions I learned:- &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;join: this is a method on the list, used to generate a string from items. Syntax is "x".join(list) 
This will generate a string with x between each item. If we use an empty string(no x) we will get a string with each item together without space.&lt;/li&gt;
&lt;li&gt;shuffle: this is a method available on random module. Its syntax is random.shuffle(list)
This will randomly shuffle the items in the list, changing their index numbers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Functions&lt;/strong&gt;:- We can make our own functions in Python. &lt;br&gt;
The syntax for it is: def name_of_function(): &lt;br&gt;
Remember to have an indentation in the code below it so that it is included in the function code block.&lt;/p&gt;

&lt;p&gt;Flow chart: This is a chart of steps we want our program to follow. It will tell us how the interpreter will follow logic so that we can write better code.&lt;/p&gt;

&lt;p&gt;Program:- 1) Hangman &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xqt7ntx9uikbuwvieqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xqt7ntx9uikbuwvieqo.png" alt="flow char for hangman" width="653" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some points I learned : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;use _ as a variable name when we are not using that variable, like looping through a list but not using its items. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;list+= x  will do same thing as list.append(x). It will add x as its last item. But be careful as it will separate characters if more than one. Using append is better choice&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when coding with while always put condition = false at the end, so that it doesn't run infinity by mistake.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to check if a value is present in the list or not, we use-- if x in string:&lt;br&gt;
we can also check it in the list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the import module command should be at top. It won't show any error though if it's not at the top. ( I don't know the reason for it, though)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://replit.com/@rohitrj332024/Hangman-day-7#main.py"&gt;https://replit.com/@rohitrj332024/Hangman-day-7#main.py&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Personal --&amp;gt; Next 3 days I am taking off from the market so, I will try to cover most of the Python topics in the course. &lt;br&gt;
One thing I hate about writing a blog on this site is that the tab key doesn't work here. It irritates a lot. I will probably write my code on Google doc now on. The only thing stopping me is I will first have to find how to put dark mode in that.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>day 04</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Thu, 23 May 2024 15:03:18 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-04-31m8</link>
      <guid>https://dev.to/lordronjuyal/day-04-31m8</guid>
      <description>&lt;p&gt;date:- 23 May, 2024.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Randomization&lt;/strong&gt;:- Computers are deterministic(we are not considering malfunctions etc). They will do what we ask them to do. They can't generate random outputs, even the AI. However, we can produce pseudo-random outputs from them by using large data and complex algorithms. Pseudo as we can still find pattern in the data but it will take significant time to reach that. To generate a random number in Python, we need a 'random module'. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Module&lt;/strong&gt;:- Often Python projects get so big that it's not possible to maintain all code in one file. To solve this we create different files for different functionality. In a project, main.py is named as the main module. This file will execute first, and other modules will be called from here.&lt;br&gt;
In Python, we are provided with many in-built modules. We save memory by including only those which are required in our program. &lt;br&gt;
To include a python module, we will have to import it into the file where we want to use it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;List&lt;/strong&gt;:- It's a data structure(way of arranging data). Its syntax is: list_name = [value1, value2]. Each value in it is arranged in order and provided a unique number called an index. The index starts from 0 and is assigned to the leftmost value. We add +1 as we move to the right. &lt;br&gt;
To access the value from the list we write:&lt;br&gt;
 list_name[index_of_value]     &amp;gt;&amp;gt;value&lt;/p&gt;

&lt;p&gt;eg list=[a,b,c,d] &lt;br&gt;
list[0] = a , list[2] = c , list[-1] = d&lt;br&gt;
We can also lists inside a list. eg list=[[a,b,c],[1,2,3]]&lt;br&gt;
list[0][1] = b&lt;/p&gt;

&lt;p&gt;String:- like lists, in string, each character is also assigned a unique index. &lt;br&gt;
eg string = "ABC"   string[0] &amp;gt;&amp;gt;"A"&lt;/p&gt;

&lt;p&gt;Functions I learned today:- &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;random.randint(a,b) -This will generate a random number between a and b, including a &amp;amp; b.&lt;/li&gt;
&lt;li&gt;random.choice(list) -This will return a random value from the list.&lt;/li&gt;
&lt;li&gt;list.append(x) - This will add value x at the end of the list. list[-1] = x&lt;/li&gt;
&lt;li&gt;list.insert(i,x) - This will insert value x at index i, shift the previous value to right(will change its index also)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Program_for_today: Rock, paper and scissors&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88sm7qp06ftgxftkyhc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88sm7qp06ftgxftkyhc5.png" alt="rock, paper, scissors game" width="800" height="1116"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>day 03</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Wed, 22 May 2024 15:58:39 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-03-15b3</link>
      <guid>https://dev.to/lordronjuyal/day-03-15b3</guid>
      <description>&lt;p&gt;date:- 22 May, 2024.&lt;br&gt;
Errors --&amp;gt; 1) Syntax error - Every programming language has to be written in a specific way. In simple words, it's the grammar of that language. These rules are called syntax. Violating them will result in syntax error. &lt;/p&gt;

&lt;p&gt;2) Indentation error - In Python, we use indentation to indicate if a code is a part of a block or not. By block, I mean some function or control flow statements. If not then there shouldn't be any space before the code else it would result in an indentation error.&lt;/p&gt;

&lt;p&gt;Built-in functions:-&lt;br&gt;
1) lower --&amp;gt; In this method(function) we pass a string which is then returned by changing all its characters into lowercase. To call it - string_to_convert.lower()&lt;br&gt;
2) count --&amp;gt; This is a method that returns the number of times a character(s) appears in the string passed. To call it - string.count('char') &lt;/p&gt;

&lt;p&gt;Comparison operator:- They are used to compare two values.&lt;br&gt;
To check if a is equal to b: a == b&lt;br&gt;
To check if a is greater than b: a &amp;gt; b&lt;br&gt;
To check if a is less than b: a &amp;lt; b&lt;br&gt;
To check if a is less than or equal to b: a &amp;lt;= b&lt;br&gt;
To check if a is greater than or equal to b: a &amp;gt;= b&lt;br&gt;
To check if a is not equal to b: a != b&lt;br&gt;
The comparison operator auto converts the result in boolean values, True or False.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control flow statements&lt;/strong&gt;:- Python interpreter executes the code from top to bottom. Control flow is the code statements that change this flow of interpreter based on some conditions defined by us.&lt;br&gt;
1) If-else statement - With the help of it we execute the code which satisfies some condition. Syntax is below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd6eogarvh6r8dn8owvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd6eogarvh6r8dn8owvb.png" alt="if-else statement" width="217" height="104"&gt;&lt;/a&gt;&lt;br&gt;
First condition 1 will be checked, if it comes to be True,&lt;br&gt;
the indented code inside the if-block will get executed. The interpreter will skip the else-block. If it is False, the if-block code is skipped and the else-block code will be executed. &lt;br&gt;
We can use an if statement inside another if/else statement. Also, we can use multiple if statements one after another. But then the interpreter has to check all the conditions. To save this we have an elif statement. It is used when conditions are related, if one occurs others can't.   &lt;/p&gt;

&lt;p&gt;Program-- I made a leap-year calculator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjd0lrf8x1afaczjpa01l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjd0lrf8x1afaczjpa01l.png" alt="leap year calculator" width="616" height="237"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Personal--&amp;gt; Yesterday, due to a loss in the market, I had to revisit my charts and strategy. So have to give a miss to coding. I am sorry for this, and I promise to do at least one coding exercise on such days so that no day go wasted.&lt;br&gt;
I have to use a photo, as in the preview indentation is not shown. I have seen other people's blogs. Those are well formatted. I hope I will improve my blog also. Right now, I won't be able to give time to it. However, I have started English grammar lessons to improve my written skills.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>day 2</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Mon, 20 May 2024 07:16:28 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-2-5f9h</link>
      <guid>https://dev.to/lordronjuyal/day-2-5f9h</guid>
      <description>&lt;p&gt;date: 20 May, 2024.&lt;br&gt;
&lt;strong&gt;Maths Operator&lt;/strong&gt;:- These are used for mathematical calculations. Python follows the PEMDAS rule. () stands for parentheses, ** stands for exponents eg 2**3 &amp;gt;8, * for multiplication, / for division, + addition, and - for subtraction.&lt;br&gt;
One main thing to remember is division of two int data types will result in a float. Also if one float is present in the calculation the result will be the float always.&lt;br&gt;
We can't do math operations on string. In the case of a boolean True =1, False =0. &lt;br&gt;
If we want to do division but want it to return int data type, we can use floor division(//). This returns quotient eg 10//3 &amp;gt;&amp;gt;3. If we want the remainder we can use % sign, eg 10%3 &amp;gt;&amp;gt;1. But we have to be careful if we are using negative numbers in the calculation, as it may give unexpected results. On searching I found floor division uses the floor function(some rounding function I will study it later) in the background, which rounds off the result to the largest integer less than or equal to the number, eg 10//-3 &amp;gt;&amp;gt; -3.333 = -4.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strings&lt;/strong&gt;:- To add other data types variables into a string when showing output, we have to convert them and then concatenate them with the string. An alternative to this is f-string, we write it like f" ... {variable}". This is auto converts variables into strings and useful when putting multiple variables in a string. Another method is to use the format method(method are like function). It can be used as: string= " ... {1} {2}"&lt;br&gt;
string.format(1=variable_1, 2=variable_2). Variable_1 and variable_2 will be placed at 1 and 2 respectively. We can leave these {} empty but better avoid it for confusion.&lt;br&gt;
We can also change the number format in a string using these two ways. eg x=1234.5678 To format it into 6 figures we can write f"{x:.6}" or {:.6}.format(x) &amp;gt;&amp;gt; 1234.56. There are many other ways to format like adding commas, showing in percentage, etc. It's better to look into documentation rather than trying to remember them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built-in functions&lt;/strong&gt;:- &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;type(variable) returns the data type of the variable&lt;/li&gt;
&lt;li&gt;type casting -it is a process of converting one data type into another.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;--&amp;gt;int(variable) converts into an integer data type. The strings data type needs to be in whole number format. For float data types decimals will be removed. In the case of boolean, True converts into 1, and False converts into 0.&lt;/p&gt;

&lt;p&gt;--&amp;gt;float(variable) converts into a float data type. Similar to int but can convert strings with decimals numbers.&lt;/p&gt;

&lt;p&gt;--&amp;gt;str(variable) converts into string. In the case of a boolean, False will turn into 'False', same with True.&lt;/p&gt;

&lt;p&gt;--&amp;gt;bool(variable) converts into a boolean data type. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;round(number, digit of precision after decimal) it will round the number to the digit of precision. If a digit of precision is not passed it will round it off to the nearest integer. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Exercises -- I did two exercises, one was to calculate BMI by taking user input. Another one is to calculate the tip based on a number of people &amp;amp; net amount and show how much each person should pay. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio8dtind8s98c70xwve6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio8dtind8s98c70xwve6.png" alt="BMI Calculator" width="630" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyfebdzzbwmbzaoofm0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyfebdzzbwmbzaoofm0y.png" alt="Tip calculator" width="694" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading my blog.&lt;/p&gt;




&lt;p&gt;Personal --&amp;gt; Today I was able to complete the day 2 fast, I am happy with the progress though I have planned more for it. I tried a codewar problem but was not able to solve it. I will try to solve it if I get some time. Tomorrow markets will be open so I have to prepare for that also. I have realized my English isn't that good, I will try to improve that also. &lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Day 01</title>
      <dc:creator>lordronjuyal</dc:creator>
      <pubDate>Sun, 19 May 2024 20:02:08 +0000</pubDate>
      <link>https://dev.to/lordronjuyal/day-01-57dc</link>
      <guid>https://dev.to/lordronjuyal/day-01-57dc</guid>
      <description>&lt;p&gt;Date: 19 May, 2024.&lt;br&gt;
Introduction--&amp;gt; Hi I am Rohit. I am a stock market trader. Now I am planning to learn algo trading. For that, I have chosen Python as my programming language. I will be writing blogs to document my progress in it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Basic&lt;/em&gt;:- Python is a high-level language. By high-level we mean, many things like memory management are taken care of in the background. The modern python is both compiled and interpreted language. Our code is first compiled and converted into a byte file. This is then interpreted line by line in PVM(a program that provides an environment to run Python).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable&lt;/strong&gt;:- Variables are things in which we can store data. We have to follow some rules in naming a variable(these rules are the same for naming any other thing in Python)&lt;br&gt;
1) The only characters we can use are numbers(0-9), small case letters(a-z), capital letters(A-Z) and underscore(_).&lt;br&gt;
2) The name should not start with a number&lt;br&gt;
3) we use snake case conviction for writing names eg snake_case&lt;br&gt;
4) Avoid using keywords(words which are assigned special meaning/use in Python)&lt;br&gt;
5) We use all capital letters for variables whose values we don't want to change&lt;br&gt;
The rule 3, 4 &amp;amp; 5 are not binding. Violating them won't give any error except 4 which may sometimes give error.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Data types&lt;/em&gt;:- There are primary 4 data types in Python. &lt;br&gt;
1) Integer - for whole numbers eg 23, -4, 0. We can't write data as 02.&lt;br&gt;
2) Float - for numbers containing decimals eg 2.47, 3.14.&lt;br&gt;
3) String - sequence of characters eg "this is Ron"&lt;br&gt;
4) Booleans - True &amp;amp; False. These are used in building logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String&lt;/strong&gt;:- String is a sequence of characters, where each character is assigned a unique integer value(index).   The leftmost side is assigned 0 as the index value and +1 as we move to the right side. On screen, it's basically a text. We can use double or single quotes to represent it, but only one type. These two are used for single-line strings. For multiple lines, we use double quotes 3 times ("""..."""). &lt;br&gt;
Escape characters - used for introducing special characters or modifying character meaning in the interpreter. &lt;br&gt;
Some are: &lt;br&gt;
  \n insert line break,&lt;br&gt;
  \t insert tab&lt;br&gt;
  \" allow using double quotes inside the double quotes&lt;br&gt;
  \' allow using single quotes inside the single quotes&lt;br&gt;
  \\ insert backslash&lt;br&gt;
String concatenation - it is the process of joining two or more strings. We use + operator for this.&lt;br&gt;
eg "string1 " + "string2" &amp;gt;&amp;gt; "string1 string2".&lt;/p&gt;

&lt;p&gt;Comments - the text that developers use for explaining what code will do. This is ignored by the interpreter. To indicate a comment we start it with #. We can also use multi-line strings for comments. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functions&lt;/strong&gt;:- Function is a name given to a part of code that performs a specified task. To use it we have to call that function. To call we use the name of the function and the brackets '()', eg func(). We pass some data(called arguments) into it(sometimes we don't pass any value). It performs a specific task and returns a value. For the best understanding, just imagine that returned value replaces the function call.&lt;br&gt;
Python provides many built-in functions. Some I learned are:- &lt;br&gt;
1) print(..) shows data passed on the screen&lt;br&gt;
2) input(..) shows data passed on the screen and waits for the user to enter(input) some data&lt;br&gt;
3) len(string) returns the length of the string. Don't confuse it with index as it starts counting from 1.&lt;br&gt;
4) id(variable) returns the memory address of that variable. It is not a binary address, but a unique number assigned by python library to the variable. It is different each time we run the program.&lt;br&gt;
! A library is a pre-written file containing many functions, which we can use or interpreter uses.&lt;/p&gt;

&lt;p&gt;Thanks for reading my blog, I would love to hear any guidance or feedback if possible.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;Personal&lt;/strong&gt;&lt;/em&gt; --&amp;gt; This is just my informal talk, you can skip it. So why learn algorithmic trading? To be honest I don't have a perfect answer to that. My programmer friend suggested I should look into this, so I am just giving it a try. If it works for me all good, if not that's also okay for me. I am also not ignoring the job perspective of it. I have chosen python as my programming language as it will be easier for a beginner like me. Later, if I like algo trading I will surely try to learn Rust or C++. &lt;br&gt;
Today day 1 was harder for me, it took me more time to cover than I thought. I am learning python from Dr. Angela Yu course on udemy. I am giving 1 year time to myself to learn algo trading. Let's see how it goes. Thanks if you have read this also.   &lt;/p&gt;

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