define action, reducer and store in react-redux

In react-redux, action, reducer, and store are defined like below:

const ADD = 'ADD'

const addMessage = (message) => ({
  type: ADD,
  message
})


const messageReducer = (state = [], action) => {
  switch (action.type) {
    case ADD …

substring with mysql

Suppose you have the following table Students

You want to query the Name whose Marks is greater than 75 in asending order by last three characters of Name and in asending order by ID

Here is one way to acheive the goal in mysql:

SELECT Name
  FROM STUDENTS
  WHERE Marks …

difference between number of all records and distict records

In sql, distinct means no duplicates. Thus, the number of all records and the number of duplicates records of one field if any, can be different.

Suppose you have the following table

If the table STATION has duplicate CITY value, you can find out the difference between the number of …

I got a python certification from freeCodeCamp!

I'm proud of myself! 🙌

You can check it out on freeCodeCamp as well.

This certificate is given to a person who finishes Scientific Computing with Python course and complete five projects. You can check out my codes on my git repository named py4e.

Print more than one thing

In python print() can take more than one argument. So the code below is legit.

>>> print(1,2,3,4,'hello')
1 2 3 4 hello

If you have a list li and you want to print li like above, separated by comma …