<?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 Pramod Ray on Medium]]></title>
        <description><![CDATA[Stories by Pramod Ray on Medium]]></description>
        <link>https://medium.com/@pramodray0215?source=rss-7b0ec3d78e93------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ViQ5AP1x3Vsu71zruXdn8g.jpeg</url>
            <title>Stories by Pramod Ray on Medium</title>
            <link>https://medium.com/@pramodray0215?source=rss-7b0ec3d78e93------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:48:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pramodray0215/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[Interview Question React Js]]></title>
            <link>https://pramodray0215.medium.com/interview-question-react-js-b66815efac37?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/b66815efac37</guid>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Sat, 06 Mar 2021 05:54:25 GMT</pubDate>
            <atom:updated>2021-03-06T06:44:27.824Z</atom:updated>
            <content:encoded><![CDATA[<ol><li>What is React js</li></ol><p>React is a JavaScript library for building user interfaces.</p><p>React is used to build single-page applications.</p><p>React allows us to create reusable UI components.</p><p>Advatnage of React js</p><p>a). It facilitates the overall process of writing components</p><p>b). It boosts productivity and facilitates further maintenance.</p><p>c). It ensures faster rendering.</p><p>d). It guarantees a stable code.</p><p>e). It is SEO friendly.</p><p>f). It comes with a helpful developer toolset.</p><p>g). It is focused and easy-to-learn.</p><p>h). It is backed by a strong community.</p><p>3. Disadvantage of react js.</p><p><strong>1. The high pace of development</strong></p><p>The high pace of development has an advantage and disadvantage both. In case of disadvantage, since the environment continually changes so fast, some of the developers not feeling comfortable to relearn the new ways of doing things regularly. It may be hard for them to adopt all these changes with all the continuous updates. They need to be always updated with their skills and learn new ways of doing things.</p><p><strong>2. Poor Documentation</strong></p><p>It is another con which are common for constantly updating technologies. React technologies updating and accelerating so fast that there is no time to make proper documentation. To overcome this, developers write instructions on their own with the evolving of new releases and tools in their current projects.</p><p><strong>3. View Part</strong></p><p>ReactJS Covers only the UI Layers of the app and nothing else. So you still need to choose some other technologies to get a complete tooling set for development in the project.</p><p><strong>4. JSX as a barrier</strong></p><p>ReactJS uses JSX. It’s a syntax extension that allows HTML with JavaScript mixed together. This approach has its own benefits, but some members of the development community consider JSX as a barrier, especially for new developers. Developers complain about its complexity in the learning curve.</p><p>5. What is virtual DOM.</p><p>The virtual DOM (VDOM) is a programming concept where an ideal, or “virtual”, representation of a UI is kept in memory and synced with the “real” DOM by a library such as ReactDOM. This process is called <a href="https://reactjs.org/docs/reconciliation.html">reconciliation</a>.</p><p>A virtual DOM is a lightweight JavaScript object which originally is just a copy of the real DOM. It is a node tree that lists the elements, their attributes and content as Objects and their properties. React’s render function creates a node tree out of the React components. It then updates this tree in response to the mutations in the data model which is caused by various actions done by the user or by the system.<br>This Virtual DOM works in three simple steps.</p><p>Whenever any underlying data changes, the entire UI is re-rendered in Virtual DOM representation.</p><h3>Why can’t browsers read JSX?</h3><p>Browsers can only read JavaScript objects but JSX is not a regular JavaScript object. Thus to enable a browser to read JSX, first, we need to transform the JSX file into a JavaScript object using JSX transformers like Babel and then pass it to the browser.</p><h3>What is Component?</h3><p>Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation and return HTML via a render() function.</p><h3>What is Props?</h3><p>Props are the shorthand for Properties in React. They are read-only components that must be kept pure i.e. immutable. They are always passed down from the parent to the child components throughout the application. A child component can never send a prop back to the parent component. This help in maintaining the unidirectional data flow and are generally used to render the dynamically generated data.</p><h3>What is a state in React and how is it used?</h3><p>States are the heart of React components. States are the source of data and must be kept as simple as possible. Basically, states are the objects which determine components rendering and behaviour. They are mutable unlike the props and create dynamic and interactive components. They are accessed via <strong>this. state().</strong></p><h3>What is the arrow function in React? How is it used?</h3><p>Arrow functions are more of a brief syntax for writing the function expression. They are also called <em>‘fat arrow</em>‘ (<strong>=&gt;</strong>) the functions. These functions allow to bind the context of the components properly since in ES6 auto binding is not available by default. Arrow functions are most useful while working with higher-order functions.</p><h3>Differentiate between stateful and stateless components.</h3><h4>Stateful vs Stateless</h4><p><strong>Stateful Component:</strong></p><ol><li>Stores info about component’s state change in memory</li><li>Have the authority to change the state</li><li>Contains the knowledge of past, current and possible future changes in state</li><li>Stateless components notify them about the requirement of the state change, then they send down the props to them.</li></ol><p><strong>Stateless Component</strong></p><ol><li>Calculates the internal state of the components</li><li>2. Do not have the authority to change the state</li><li>Contains no knowledge of past, current and possible future state changes</li><li>They receive the props from the Stateful components and treat them as callback functions.</li></ol><h3>What are the different phases of React component’s lifecycle?</h3><p>There are three different phases of React component’s lifecycle:</p><ol><li><em>Initial Rendering Phase:</em> This is the phase when the component is about to start its life journey and make its way to the DOM.</li><li><em>Updating Phase: </em>Once the component gets added to the DOM, it can potentially update and re-render only when a prop or state change occurs. That happens only in this phase.</li><li><em>Unmounting Phase: </em>This is the final phase of a component’s life cycle in which the component is destroyed and removed from the DOM.</li></ol><h3>Explain the lifecycle methods of React components in detail.</h3><p>Some of the most important lifecycle methods are:</p><ol><li><strong><em>componentWillMount()</em> — </strong>Executed just before rendering takes place both on the client as well as server-side.</li><li><strong><em>componentDidMount()</em> — </strong>Executed on the client-side only after the first render.</li><li><strong><em>componentWillReceiveProps() </em></strong>— Invoked as soon as the props are received from the parent class and before another render is called.</li><li><strong><em>shouldComponentUpdate()</em> — </strong>Returns true or false value based on certain conditions. If you want your component to update, return <strong>true</strong> else return <strong>false</strong>. By default, it returns false.</li><li><strong><em>componentWillUpdate()</em> </strong>— Called just before rendering takes place in the DOM.</li><li><strong><em>componentDidUpdate()</em> — </strong>Called immediately after rendering takes place.</li><li><strong><em>componentWillUnmount()</em> </strong>— Called after the component is unmounted from the DOM. It is used to clear up the memory spaces.</li></ol><h3>What are synthetic events in React?</h3><p>Synthetic events are the objects which act as a cross-browser wrapper around the browser’s native event. They combine the behaviour of different browsers into one API. This is done to make sure that the events show consistent properties across different browsers.</p><h3>What do you understand by refs in React?</h3><p>Refs are the shorthand for References in React. It is an attribute that helps to store a reference to a particular React element or component, which will be returned by the components render configuration function. It is used to return references to a particular element or component returned by render(). They come in handy when we need DOM measurements or to add methods to the components.</p><pre><strong>class</strong> ReferenceDemo <strong>extends</strong> React.Component{</pre><pre>display() {</pre><pre><strong>const</strong> name = <strong>this</strong>.inputDemo.value;</pre><pre>document.getElementById(&#39;disp&#39;).innerHTML = name;</pre><pre>}</pre><pre>render() {</pre><pre><strong>return</strong>(</pre><pre>&lt;div&gt;</pre><pre>Name: &lt;input type=&quot;text&quot; ref={input =&gt; <strong>this</strong>.inputDemo = input} /&gt;</pre><pre>&lt;button name=&quot;Click&quot; onClick={<strong>this</strong>.display}&gt;Click&lt;/button&gt;</pre><pre>&lt;h2&gt;Hello &lt;span id=&quot;disp&quot;&gt;&lt;/span&gt; !!!&lt;/h2&gt;</pre><pre>&lt;/div&gt;</pre><pre>);</pre><pre>}</pre><pre>}</pre><h3>List some of the cases when you should use Refs.</h3><p>Following are the cases when refs should be used:</p><ul><li>When you need to manage focus, select text or media playback</li><li>To trigger imperative animations</li><li>Integrate with third-party DOM libraries</li></ul><h3>What are Higher-Order Components(HOC)?</h3><p>Higher-Order Component is an advanced way of reusing the component logic. Basically, it’s a pattern that is derived from React’s compositional nature. HOC are custom components that wrap another component within it. They can accept any dynamically provided child component but they won’t modify or copy any behaviour from their input components. You can say that HOC is ‘pure’ components.</p><h3>What can you do with HOC?</h3><p>HOC can be used for many tasks like:</p><ul><li>Code reuse, logic and bootstrap abstraction</li><li>Render High jacking</li><li>State abstraction and manipulation</li><li>Props manipulation</li></ul><h3>What are Pure Components?</h3><p><em>Pure </em>components are the simplest and fastest components that can be written. They can replace any component which only has a <strong>render(). </strong>These components enhance the simplicity of the code and the performance of the application.</p><h3>What is the significance of keys in React?</h3><p>Keys are used for identifying unique Virtual DOM Elements with their corresponding data driving the UI. They help React to optimize the rendering by recycling all the existing elements in the DOM. These keys must be a unique number or string, using which React just reorders the elements instead of re-rendering them. This leads to an increase in the application’s performance.</p><h3>What is Redux?</h3><p>Redux is one of the most trending libraries for front-end development in today’s marketplace. It is a predictable state container for JavaScript applications and is used for the entire applications state management. Applications developed with Redux are easy to test and can run in different environments showing consistent behavior.</p><h3>What are the three principles that Redux follows?</h3><ol><li><strong><em>Single source of truth: </em></strong>The state of the entire application is stored in an object/ state tree within a single store. The single state tree makes it easier to keep track of changes over time and debug or inspect the application.</li><li><strong><em>State is read-only: </em></strong>The only way to change the state is to trigger an action. An action is a plain JS object describing the change. Just like state is the minimal representation of data, the action is the minimal representation of the change to that data.</li><li><strong><em>Changes are made with pure functions:</em></strong> In order to specify how the state tree is transformed by actions, you need pure functions. Pure functions are those whose return value depends solely on the values of their arguments.</li></ol><h3>What do you understand by “Single source of truth”?</h3><p>Redux uses ‘Store’ for storing the application’s entire state at one place. So all the component’s state are stored in the Store and they receive updates from the Store itself. The single state tree makes it easier to keep track of changes over time and debug or inspect the application.</p><h3>List down the components of Redux.</h3><p>Redux is composed of the following components:</p><ol><li><strong>Action</strong> — It’s an object that describes what happened.</li><li><strong>Reducer </strong>— It is a place to determine how the state will change.</li><li><strong>Store</strong> — State/ Object tree of the entire application is saved in the Store.</li><li><strong>View</strong> — Simply displays the data provided by the Store.</li></ol><p>In case you are facing any challenges with these React interview questions, please comment on your problems in the section below.</p><h3>How are Actions defined in Redux?</h3><p>Actions in React must have a type property that indicates the type of ACTION being performed. They must be defined as a String constant and you can add more properties to it as well. In Redux, actions are created using the functions called Action Creators. Below is an example of Action and Action Creator:</p><pre>function addTodo(text) {</pre><pre><strong>return</strong> {</pre><pre>type: ADD_TODO,</pre><pre>text</pre><pre>}</pre><pre>}</pre><h3>Explain the role of Reducer.</h3><p>Reducers are pure functions which specify how the application’s state changes in response to an ACTION. Reducers work by taking in the previous state and action, and then it returns a new state. It determines what sort of update needs to be done based on the type of the action, and then returns new values. It returns the previous state as it is, if no work needs to be done.</p><h3>What is the significance of Store in Redux?</h3><p>A store is a JavaScript object which can hold the application’s state and provide a few helper methods to access the state, dispatch actions and register listeners. The entire state/ object tree of an application is saved in a single store. As a result of this, Redux is very simple and predictable. We can pass middleware to the store to handle the processing of data as well as to keep a log of various actions that change the state of stores. All the actions return a new state via reducers.</p><h3>What are the advantages of Redux?</h3><p>Advantages of Redux are listed below:</p><ul><li><strong>Predictability of outcome — </strong>Since there is always one source of truth, i.e. the store, there is no confusion about how to sync the current state with actions and other parts of the application.</li><li><strong>Maintainability — </strong>The code becomes easier to maintain with a predictable outcome and strict structure.</li><li><strong>Server-side rendering </strong>— You just need to pass the store created on the server, to the client side. This is very useful for initial render and provides a better user experience as it optimizes the application performance.</li><li><strong>Developer tools — </strong>From actions to state changes, developers can track everything going on in the application in real time.</li><li><strong>Community and ecosystem — </strong>Redux has a huge community behind it which makes it even more captivating to use. A large community of talented individuals contribute to the betterment of the library and develop various applications with it.</li><li><strong>Ease of testing — </strong>Redux’s code is mostly functions which are small, pure and isolated. This makes the code testable and independent.</li><li><strong>Organization — </strong>Redux is precise about how code should be organized, this makes the code more consistent and easier when a team works with it.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b66815efac37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding text-input key and value dynamically in React-js]]></title>
            <link>https://pramodray0215.medium.com/adding-text-input-key-and-value-dynamically-in-react-js-7c5f2e4fa2ac?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c5f2e4fa2ac</guid>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Wed, 13 May 2020 06:19:04 GMT</pubDate>
            <atom:updated>2020-05-13T06:19:04.187Z</atom:updated>
            <content:encoded><![CDATA[<p>if we wants to key and value add dynamically.</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class Demo extends Component{</pre><pre>constructor(props) {</pre><pre>super(props);</pre><pre>this.state = {</pre><pre>users: [{firstName: &quot;&quot;, lastName: &quot;&quot;}]</pre><pre>};</pre><pre>this.handleSubmit = this.handleSubmit.bind(this);</pre><pre>}</pre><pre>addClick(){</pre><pre>this.setState(prevState =&gt; ({</pre><pre>users: [...prevState.users, { firstName: &quot;&quot;, lastName: &quot;&quot; }]</pre><pre>}))</pre><pre>}</pre><pre>createUI(){</pre><pre>return this.state.users.map((el, i) =&gt; (</pre><pre>&lt;div key={i}&gt;</pre><pre>&lt;input placeholder=&quot;First Name&quot; name=&quot;firstName&quot; value={el.firstName ||&#39;&#39;} onChange={this.handleChange.bind(this, i)} /&gt;</pre><pre>&lt;input placeholder=&quot;Last Name&quot; name=&quot;lastName&quot; value={el.lastName ||&#39;&#39;} onChange={this.handleChange.bind(this, i)} /&gt;</pre><pre>&lt;input type=&#39;button&#39; value=&#39;remove&#39; onClick={this.addClick.bind(this,i)}/&gt;</pre><pre>&lt;/div&gt;</pre><pre>))</pre><pre>}</pre><pre>handleChange(i, e) {</pre><pre>const { name, value } = e.target;</pre><pre>let users = [...this.state.users];</pre><pre>users[i] = {...users[i], [name]: value};</pre><pre>this.setState({ users });</pre><pre>}</pre><pre>removeClick(i){</pre><pre>let users = [...this.state.users];</pre><pre>users.splice(i, 1);</pre><pre>this.setState({ users });</pre><pre>}</pre><pre>handleSubmit(event) {</pre><pre>console.log(&#39;A name was submitted: &#39; + JSON.stringify(this.state.users));</pre><pre>console.log(this.state.users)</pre><pre>event.preventDefault();</pre><pre>}</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;form onSubmit={this.handleSubmit}&gt;</pre><pre>{this.createUI()}</pre><pre>&lt;input type=&#39;button&#39; value=&#39;add more&#39; onClick={this.addClick.bind(this)}/&gt;</pre><pre>&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;</pre><pre>&lt;/form&gt;</pre><pre>);</pre><pre>}</pre><pre>}</pre><pre>export default Demo;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c5f2e4fa2ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom DropDown using for filter react-table in Reactjs]]></title>
            <link>https://pramodray0215.medium.com/custom-dropdown-using-for-filter-react-table-in-reactjs-d92f1470c0c8?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/d92f1470c0c8</guid>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Wed, 13 May 2020 05:12:54 GMT</pubDate>
            <atom:updated>2020-05-13T05:15:03.052Z</atom:updated>
            <content:encoded><![CDATA[<p>When we using react-table , we can use dropDown and filter table data:</p><p>Follow the step by step</p><ol><li>install npm react-table6</li></ol><pre>import React, {Component} from &#39;react&#39;;<br>import ReactTable from &#39;react-table-6&#39;;<br>import { Form} from &#39;react-bootstrap&#39;;<br>import &#39;react-table-6/react-table.css&#39;;</pre><pre>class CustomFilter extends Component{<br> constructor(props) {<br>    super(props);<br>    this.state = {<br>      data=[],<br>     subtype:&#39;&#39;,</pre><pre>};<br>  }<br>componentDidMount() {<br>    fetch(`<a href="http://dummy.restapiexample.com/api/v1/employees">http://api.livingwatersmuseum.org:8080/stories/resources`</a>)<br>      .then(res =&gt; res.json())<br>      .then(<br>        result =&gt; {<br>          this.setState({<br>            <br>            data: result.data,<br>          });<br>        },<br>        error =&gt; {CustomFilter<br>          this.setState({<br>            <br>            error,<br>          });<br>        }<br>      );<br>  }<br>render(){<br>return(<br>&lt;div&gt; &lt;Form.Control as=&quot;select&quot; name=&quot;data&quot;<br>                        value={this.state.subtype} <br>                        onChange={(event) =&gt; <br>                       this.setState({subtype:event.target.value})}&gt;<br>                     &lt;option value =&#39;&#39;&gt;employee_name&lt;/option&gt;<br>                     &lt;option value=&#39;books&#39;&gt; employee_age &lt;/option&gt;<br>                     &lt;option value=&#39;films&#39;&gt;employee_salary&lt;/option&gt;<br>                          <br>                        &lt;/Form.Control&gt;<br>&lt;ReactTable<br>            loading={false}<br>            defaultPageSize={10}<br>            data={this.state.stories}<br>            filtered={[{ <br>              id: &#39;subType&#39;,<br>              value: this.state.subtype,<br>            }]}</pre><pre>columns={[<br>              {<br>                Header: &#39;Name&#39;,<br>                accessor: &#39;employee_name&#39;,<br>                style: {whiteSpace: &#39;unset&#39;},<br>              },<br>              {<br>                Header: &#39;Age&#39;,<br>                accessor: &#39;employee_age&#39;,<br>                style: {whiteSpace: &#39;unset&#39;},<br>},</pre><pre>{<br>Header:&#39;Salary&#39;,<br>accessor:&#39;employee_salry&#39;</pre><pre>}            ]}<br>          /&gt;<br>&lt;/div&gt;)</pre><pre>}<br>export default CustomFilter</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d92f1470c0c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django day-1]]></title>
            <link>https://pramodray0215.medium.com/django-day-1-4455837cb9f3?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/4455837cb9f3</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Thu, 03 Oct 2019 02:49:30 GMT</pubDate>
            <atom:updated>2019-10-03T10:55:43.137Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installation : Django installation is very easy follow the following steps:</strong></p><p><strong>. First Create virtual Environment</strong></p><pre>Create virtual Environment<br>&gt; python3<br>&gt;&gt;&gt; import pytz<br>&gt;&gt;&gt; exit()<br>&gt; python3 -m venv .venv<br>&gt; python3<br>&gt;&gt;&gt; bin<br>&gt;&gt;&gt; exit()<br>&gt; source .venv/bin/activate<br>&gt; pip3 install request<br>&gt; import request<br>&gt; deactivate<br>&gt; check freeze<br>&gt; pip3 freeze<br>&gt; source .venv/bin/activate<br>&gt; pip3 freez</pre><p><strong>. Install django</strong></p><pre>&gt; pip install django<br>&gt; pip3 freeze<br>&gt; django-admin startpoint hello-world!<br>&gt; cd hello-world!<br></pre><p>The development server:</p><pre>$python manage.py runserver<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4455837cb9f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phython]]></title>
            <link>https://pramodray0215.medium.com/phython-15b0ed69d9eb?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/15b0ed69d9eb</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Tue, 01 Oct 2019 16:16:38 GMT</pubDate>
            <atom:updated>2019-10-01T16:16:38.475Z</atom:updated>
            <content:encoded><![CDATA[<p>Phython</p><p>&gt;Python is a general purpose, dynamic, high level, and interpreted programming language.</p><p>&gt;It supports Object Oriented programming approach to develop applications. It is simple and easy to learn and provides lots of high-level data structures.</p><p>&gt;Python is easy to learn yet powerful and versatile scripting language, which makes it attractive for Application Development.</p><p>Python Print():</p><p>The full syntax is:</p><pre>print(*objects, sep=&#39; &#39;, end=&#39;\n&#39;, file=sys.stdout, flush=False)</pre><h3>print() Parameters</h3><ul><li><strong>objects</strong> — object to the printed. <strong>*</strong> indicates that there may be more than one object</li><li><strong>sep</strong> — objects are separated by sep. <strong>Default value</strong>: &#39; &#39;</li><li><strong>end</strong> — end is printed at last</li><li><strong>file</strong> — must be an object with write(string) method. If omitted it, sys.stdout will be used which prints objects on the screen.</li><li><strong>flush</strong> — If True, the stream is forcibly flushed. <strong>Default value</strong>: False</li></ul><p><strong>Note: </strong>sep, end, file and flush are keyword arguments. If you want to use sep argument, you have to use:</p><p><strong>Various Type sPrint Output In Python</strong></p><pre>print(&quot;My name is Pramod Ray&quot;)#output : My name is Pramod Ray<br>print(&quot;Ram&quot;,&quot;Gopi&quot;,&quot;Lav&quot;,&quot;kush&quot;)#output: RamGopiLavKush<br>print(&quot;Ram&quot;,&quot;Gopi&quot;,&quot;Lav&quot;,&quot;kush&quot;,sep = &quot;,&quot;)<br>#output : Ram,Gopi,Lav,Kush<br>print(&quot;Ram&quot;,&quot;Gopi&quot;,&quot;Lav&quot;,&quot;kush&quot;,end = &quot;-&quot;)<br>#output : Ram-Gopi-Lav-Kush-<br>print(*[1,2,3,4,5]) output : 1,2,3,4,5</pre><pre>print([1,2,3,4]) output : [1,2,3,4]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15b0ed69d9eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day14]]></title>
            <link>https://pramodray0215.medium.com/day14-3a87349b9098?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a87349b9098</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Tue, 01 Oct 2019 15:57:51 GMT</pubDate>
            <atom:updated>2019-10-01T15:57:51.178Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Modular Programming</strong>: Modular programming is technique split code in separate parts.In other words: Minimization of dependencies is the goal.</p><pre>Advantage of modular Programming<br>1. Simplicity<br>2. Maintainability<br>3. Re-usability<br>4. Scoping</pre><p>Python Modules:</p><pre>1. A module can be written in python itself.(suffix .py)<br>2. A module can be written in c and loaded dynamically at the run-time, like the re(regular expression), datetime, calendar e.t.c<br></pre><p>The Module Search Path: When the interpreter the above import statement, it searched for mod.py .</p><pre>1. The directory from which the input script was run on the current   directory if the interpreter is being run interactively<br>2. The list of directories contained in the PythonPath environment variable<br>3. An installation-dependent list of directories configured at the time Python in installed</pre><p>The import Statement: Module contents are made available to the caller with the import statement.</p><pre>import &lt;module_name&gt;</pre><p>An alternate from of the import statement allow individual objects the module to be imported directly into the caller’s symbol table</p><pre>from &lt;module_name&gt;import module</pre><p>It is also possible to import individual object but enter them into the local symbol table with alternate names</p><pre>from &lt;module_name&gt; import&lt;name&gt; as&lt;alt_name&gt;</pre><p><strong>Package :</strong> In Python, When the number of modules in any project grows significantly, it is wiser to organize them into packages that is, placing functionally similar modules/classes in the same directory. or,</p><p>Package are a way of structuring many modules which helps in a well-organized hierarchy of data set, making the directories and modules easy to access. Just like there are different drives and folders in an OS to help us store files, similarly packages help us in storing other sub-packages and modules, so that it can be used by the user when necessary.</p><p><strong>Steps of create package :</strong></p><ol><li>Create a directory and give it your package’s name.</li><li>Put your classes in it.</li><li>Create a <strong>__init__.py</strong> file in the directory</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a87349b9098" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day15]]></title>
            <link>https://pramodray0215.medium.com/day15-57642080b4a1?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/57642080b4a1</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Fri, 27 Sep 2019 13:13:29 GMT</pubDate>
            <atom:updated>2019-10-01T15:10:16.010Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Exception handling : </strong>Exception handling is one of the powerful mechanism to handle the run-time error. And maintain the flow of execution.</p><p><strong>Handling an exception</strong> : In the code is running and exception handling maintain the flow of execution using try block, include except: statement.</p><p>Try: <strong>try</strong> block is used to enclose the code that might throw an exception. It must be used within the method.</p><p>If an exception occurs at the particular statement of try block, the rest of the block code will not execute. So, it is recommended not to keeping the code in try block that will not throw an exception.</p><p>Python try block must be followed by either except or finally block.</p><pre>example: -<br>Syntax:<br>try:<br>    a = 10<br>    b = 0<br>    c = a/b<br>    print(&quot;output&quot;,c)<br>except Exception:<br>    print(&quot;something is error&quot;)</pre><p><strong>Argument of an Exception </strong>: An exception can have an argument, which is a value that give the reference of exception</p><pre>try:<br>    a = 10<br>    b = 0<br>    c = a/b<br>    print(&quot;output&quot;,c)<br>except Exception as ex:<br>    print(&quot;something is error&quot;,ex)</pre><p><strong>The except Clause with No Exception: </strong>This kind of a try statement catches all the exception , but does not make the programmer identify the root cause of the problem.</p><pre>try:<br>    a = 10<br>    b = 0<br>    c = a/b<br>    print(&quot;output&quot;,c)<br>except Exception as ex:<br>    print(&quot;something is error&quot;,ex)<br>else:<br>    print(&quot;there is no exception&quot;)</pre><p><strong>Raising an Exception : </strong>You can raise exception in several ways by using the raise statement.</p><pre>raise [Exception [, args [, trackback]]]</pre><p><strong>User-Defined Exceptions :</strong> Python allows user to create own exception by deriving class from the standard built-in exception.</p><pre>try:<br>    raise Network-error(&quot;Bad host-man&quot;)<br>except Network-error,e:<br>    print(e)</pre><p><strong>Datetime : date, time and datetime</strong> classes provides a number of function to deal with dates, times and time intervals. Date and datetime are an object in Python, so when you manipulate them, you are actually manipulating objects and not string or timestamps. Whenever you manipulate dates or time, you need to import datetime function.</p><p>There are two kinds of date and time object : naive and aware</p><p><strong>Naive :</strong> A naive object does not contain enough information to unambiguously locate itself relative. Whether a naive object represent Coordinate Universal Time (UTC), local time, in some timezone is purely up to the program, just like it is up to the program whether a particular number represent meters, miles or mass. Native object are easy to understand and to work with, at the cost of ignoring some aspects of reality.</p><p><strong>Aware : </strong>An aware object has sufficient knowledge of applicable algorithm and political time adjustment such as time zone and daylight saving time information, to locate itself relative to other aware objects. An aware object is used is used to represent a specific in time.</p><h3><strong>JSON </strong>: JSON stands for JavaScript object Notation</h3><p>JSON is an open standard for exchanging data on the web. It supports data structures like object and array. So it is easy to write and read data from JSON.</p><ul><li>JSON stands for JavaScript Object Notation.</li><li>JSON is an open standard data-interchange format.</li><li>JSON is lightweight and self describing.</li><li>JSON is easy to read and write.</li><li>JSON is language independent.</li><li>JSON supports data structures such as array and objects.</li></ul><h3>Features of JSON</h3><ol><li>Simplicity</li><li>Openness</li><li>Self Describing</li><li>Internationalization</li><li>Extensibility</li><li>Interoperability</li></ol><pre>import json<br>{<br>   &quot;firstName&quot; : &quot;Yuraj&quot;,<br>   &quot;lastName&quot; : &quot;Singh&quot;,<br>   &quot;hobbies&quot; : [&quot;running&quot;, &quot;playing-cricket&quot;, &quot;singing&quot;],<br>}</pre><p>Python comes with built-in package called json for encoding and decoding JSON data.</p><p>The process of encoding Json is usually called serialization. (Pickling)</p><p>Serialization is the reciprocal process of decoding data that has been stored or delivered in the JSON standard. (Depickling)</p><p><strong>dump(data, fp)</strong>: This method is using for writing data to files. Data is object to be serialized. fp is file-like object to which the bytes will be written.</p><pre>import json<br>data = {&quot;user&quot; :{&quot;username&quot; : &quot;Sonam&quot;,&quot;password&quot; : &quot;mickey@1122&quot;}}<br>write_file = open(&quot;data_file.json&quot;,&quot;w&quot;)<br>json.dump(data, write_file)<br>write_file.close()</pre><p>dumps(): This method used for writing to a python string.</p><pre>json_string = json.dumps(data)</pre><p>load() : Turning JSON encoded data from a file into python objects.</p><pre>import json<br>read_file = open(&quot;data_file.json&quot;, &quot;r&quot;)<br>data = json.load(read_file)</pre><p>loads() : Turning JSON encoded data from a string into Python objects.</p><pre>import json<br>data = {&quot;user&quot; :{&quot;username&quot; : &quot;Sonam&quot;,&quot;password&quot; : &quot;mickey@1122&quot;}}<br>write_file = open(&quot;data_file.json&quot;,&quot;w&quot;)<br>data_object = json.loads(data)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57642080b4a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day12]]></title>
            <link>https://pramodray0215.medium.com/day12-57b21b046d33?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/57b21b046d33</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 12:15:13 GMT</pubDate>
            <atom:updated>2019-09-25T16:34:25.624Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Inheritance :</strong> Inheritance is one of the oops mechanism which allow to invoking all base class properties into child properties.</p><p>There are is creating two types relation-ship in between parents and child classes</p><pre>1. IS-A(inheritance relationship)<br>2. Has-A(Composition relationship)</pre><p>There are 3-types of inheritance.</p><pre>1. Single inheritance<br>2. Multiple inheritance<br>3. Multi-level inheritance</pre><p><strong>Single inheritance :</strong> In this types of inheritance which is use parents properties invoke in child class :</p><p>Is-A(inheritance relationship)</p><pre><strong>Example Is-A(inheritance relationship):-<br>class</strong> Parent:<br>    parent_name = &quot;&quot;<br>    child_name = &quot;&quot;<br> <br>    <strong>def</strong> show_parent(self):<br>        <strong>print</strong>(self.parent_name)<br> <br> <br><strong>class</strong> Child(Parent):<br>    <strong>def</strong> show_child(self):<br>        <strong>print</strong>(self.child_name)<br> <br> <br>ch1 = Child()  <br>ch1.parent_name = &quot;Sachin&quot;  <br>ch1.child_name = &quot;Arjuna&quot;<br>ch1.show_parent()   <br>ch1.show_child()</pre><p>Has-A (Composition-relationship)</p><pre>class Book:<br>    def __init__(self, name,author,publication, price, genre):<br>        self.name=name<br>        self.author=author<br>        self.publication=publication<br>        self.price=price<br>        self.genre=genre<br>    def show_details(self):<br>        return&quot;{} {} {} {} {}&quot;.format(self.name, self.author, self.publication,self.price, self.genre)<br><br><br>class Member:<br>    def __init__(self,name, id, address):<br>        self.name=name<br>        self.id=id<br>        self.address=address<br><br>class Library:<br>    working_hours = 24<br><br>    def __init__(self, name, location):<br>        self.name = name<br>        self.location = location<br><br>    @classmethod<br>    def change_time(cls, new_time):<br>        cls.working_hours = new_time<br><br>class Librarian:<br>    def __init__(self, name, gender, qualification, experience):<br>        self.name = name<br>        self.gender = gender<br>        self.qualification = qualification<br>        self.experience = experience<br>        self.list_of_books = []<br><br>    def find_total_books(self):<br>        return len(self.list_of_books)<br><br>    def open_lib(self):<br>        return &quot;library opened&quot;<br><br>    def issue_book(self, book_name):<br>        self.list_of_books.remove(book_name)<br>        return &quot;book issued&quot;<br><br>    def add_book(self, book_name):<br>        self.list_of_books.append(book_name)<br>        return &quot;book added&quot;<br><br>    def impose_fine(self):<br>        return &quot;pay fine&quot;<br><br>    def close_lib(self):<br>        return &quot;library closed&quot;<br><br>class Book:<br>    def __init__(self, name, author, publication, price, genre):<br>        self.name = name<br>        self.author = author<br>        self.publication = publication<br>        self.price = price<br>        self.genre = genre<br><br>    def show_details(self):<br>        return &quot;{} {} {} {} {}&quot;.format(self.name, self.author, self.publication, self.price, self.genre)<br><br>class Member:<br>    def __init__(self, name, id, address):<br>        self.name = name<br>        self.id = id<br>        self.address = address<br><br>    def borrow_book(self):<br>        return &quot;The book is borrowed&quot;<br><br>    def return_book(self):<br>        return &quot;The book is returned&quot;<br><br>    def pay_fine(self):<br>        return &quot;The fine to be paid&quot;<br><br>sachin = Member(&quot;sachin&quot;, &quot;#001&quot;, &quot;bangalore&quot;)<br>saurabh = Member(&quot;saurabh&quot;, &quot;#002&quot;, &quot;bangalore&quot;)<br>rsagarwal = Librarian(&quot;rsagarwal&quot;, True, &quot;3rd grade&quot;, 50)<br>rdsharma = Book(&quot;rdsharma&quot;, &quot;sharmaji&quot;, &quot;shawarma&quot;, 100, &quot;shorma&quot;)<br>rsagarwal.list_of_books.append(rdsharma)<br>library = Library(&quot;420&quot;, &quot;bangalore&quot;)<br>print(&quot;Total number of books in library&quot;, rsagarwal.find_total_books())</pre><p>Super() : It provides the access to those methods of the parent class which have been overridden in a child class that inherits from it.</p><pre>example:<br><strong>class</strong> Square:</pre><pre><strong>def</strong> __init__(self, side):</pre><pre>self.side <strong>=</strong> side</pre><pre><strong>def</strong> area(self):</pre><pre><strong>return</strong> self.side <strong>*</strong> self.side</pre><pre><strong>class</strong> Cube(Square):</pre><pre><strong>def</strong> area(self):</pre><pre>face_area <strong>=</strong> self.side <strong>*</strong> self.side</pre><pre><strong>return</strong> face_area <strong>*</strong> 6</pre><pre><strong>def</strong> volume(self):</pre><pre>face_area <strong>=</strong> self.side <strong>*</strong> self.side</pre><pre><strong>return</strong> face_area <strong>*</strong> self.side</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57b21b046d33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day13]]></title>
            <link>https://pramodray0215.medium.com/day13-9b8309211098?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b8309211098</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 12:09:09 GMT</pubDate>
            <atom:updated>2019-09-23T12:09:09.924Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Multiple Inheritance :</strong> In this type of inheritance have two parents classes invoking in single child class.</p><pre>Example :<br>class Run:<br>    def __init__(self, total_run):<br>        self.total_run = total_run<br><br>    def run(self):<br>        return &quot;{}&quot;.format(self.total_run)<br><br>class Wicket:<br>    def __init__(self, total_wicket):<br>        self.total_wicket = total_wicket<br><br>    def loss_wicket(self):<br>        return &quot;{}&quot;.format(self.total_wicket)<br><br><br>class Score(Run,Wicket):<br>    def __init__(self):<br>        Run.__init__(self, 210)<br>        Wicket.__init__(self, 9)<br><br>score1 = Score()<br>print(score1.loss_wicket())<br>print(score1.run())</pre><p><strong>Multi-level Inheritance :</strong> In multiple inheritance one child class can inherit multiple parent classes.</p><pre>Example:-<br><br>class student:<br>    def get_Student(self):<br>        self.name = input(&quot;Name: &quot;)<br>        self.age = input(&quot;Age: &quot;)<br>        self.gender = input(&quot;Gender: &quot;)<br><br><br>class test(student):<br>    def get_Marks(self):<br>        self.student_Class = input(&quot;Class: &quot;)<br>        print(&quot;Enter the marks of the respective subjects&quot;)<br>        self.literature = int(input(&quot;Literature: &quot;))<br>        self.math = int(input(&quot;Math: &quot;))<br>        self.biology = int(input(&quot;Biology: &quot;))<br>        self.physics = int(input(&quot;Physics: &quot;))<br><br><br>class marks(test):<br><br>    def display(self):<br>        print(&quot;\n\nName: &quot;,self.name)<br>        print(&quot;Age: &quot;,self.age)<br>        print(&quot;Gender: &quot;,self.gender)<br>        print(&quot;Study in: &quot;,self.student_Class)<br>        print(&quot;Total Marks: &quot;, self.literature + self.math + self.biology + self.physics)<br><br><br>m1 = marks()<br><br>m1.get_Student()<br><br>m1.get_Marks()<br><br>m1.display()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b8309211098" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day10]]></title>
            <link>https://pramodray0215.medium.com/day10-37482ed22c49?source=rss-7b0ec3d78e93------2</link>
            <guid isPermaLink="false">https://medium.com/p/37482ed22c49</guid>
            <dc:creator><![CDATA[Pramod Ray]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 10:57:44 GMT</pubDate>
            <atom:updated>2019-09-23T12:50:53.434Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Iterator : </strong>Iterator in python is simply an object that can be iterated . An object which will return data, one element at a time.</p><p>Python iterator object must implemented two special method, iter() and next(), collectively called the iterator protocol.</p><p>The iter() function(which is turn calls the iter() method) returns an iterator from them.</p><pre>Syntax iter()<br>list = [1,2,3,4,5]<br>listIter = iter(list)<br><strong>print</strong>(next(listIter))<br><strong>print</strong>(next(listIter))<br><strong>print</strong>(next(listIter))<br><strong>print</strong>(next(listIter))<br><strong>print</strong>(next(listIter))</pre><p><strong>Generator :</strong> A python generator is a kind of an iterable, like a python list or a python tuple. It generates for us a sequence of values that we can iterate on.</p><p>If function contains at least one yield statement (it may contain other yield or return statement s), It becomes a generator function. Both yield and return will return some value from a function.</p><pre>Syntax:<br>def counter():<br>    i=1<br>    while(i&lt;10):<br>        yield i<br>        i+=1</pre><pre>Example :<br>def my_gen(x):<br>  while(x&gt;0):<br>    if x%2==0:<br>      yield &#39;even&#39;<br>    else:<br>       yield &#39;odd&#39;<br>    x-=1<br>for i in my_gen(7):<br>     print(i)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37482ed22c49" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>