Skip to content

Instantly share code, notes, and snippets.

View hossainlab's full-sized avatar
😎
Probably Learning!

Jubayer Hossain hossainlab

😎
Probably Learning!
View GitHub Profile
@hossainlab
hossainlab / important_online_tools.md
Last active January 17, 2021 18:18
Important tools for web developer.These are very important tools for developing a complete web application.
@hossainlab
hossainlab / find_large_item.md
Last active October 15, 2018 15:39
Python Program to Find the Largest Number in a List

Python Program to Find the Largest Number in a List

This is a Python Program to find the largest number in a list.

Problem Description

The program takes a list and prints the largest number in the list.

Problem Solution

  1. Take in the number of elements and store it in a variable.
  2. Take in the elements of the list one by one.
@hossainlab
hossainlab / second_large_list.md
Created August 18, 2018 17:46
How To Find the Second Largest Number in a List

Python Program to Find the Second Largest Number in a List

This is a Python Program to find the Second largest number in a list.

Problem Description

The program takes a list and prints the Second largest number in the list.

Problem Solution

  1. Take in the number of elements and store it in a variable.
  2. Take in the elements of the list one by one.
@hossainlab
hossainlab / smal_item_list.md
Last active August 18, 2018 17:48
How To Find the Smallest Number in a List

Python Program to Find the Smallest Number in a List

This is a Python Program to find the Smallest number in a list.

Problem Description

The program takes a list and prints the smallest number in the list.

Problem Solution

  1. Take in the number of elements and store it in a variable.
  2. Take in the elements of the list one by one.
@hossainlab
hossainlab / second_small_list.md
Last active August 22, 2022 15:09
How To Find the Second Smallest Number in a List

This is a Python Program to find the Second Smallest number in a list.

Problem Description

The program takes a list and prints the second smallest number in the list.

Problem Solution

  1. Take in the number of elements and store it in a variable.
  2. Take in the elements of the list one by one.
  3. Sort the list in ascending order.
  4. Print the last element of the list.
@hossainlab
hossainlab / sum_list.md
Last active December 7, 2018 18:20
How To find the sum of all the elements in a list.

To find the sum of all the elements in a list.

  1. Read input number asking for length of the list using input()
  2. Initialise an empty list lst = [].
  3. Read each number using a for loop.
  4. In the for loop append each number to the list.
  5. Now we use predefined function sum() to find the sum of all the elements in a list.
  6. Print the result.
@hossainlab
hossainlab / avg_list.md
Last active April 10, 2022 10:53
How To Calculate the Average of Numbers in a Given List

This is a Python Program to Calculate the Average of Numbers in a Given List.

Problem Description

The program takes the elements of the list one by one and displays the average of the elements of the list.

Problem Solution

  1. Take the number of elements to be stored in the list as input.
  2. Use a for loop to input elements into the list.
  3. Calculate the total sum of elements in the list.
  4. Divide the sum by total number of elements in the list.
// ! Comparison Operators and Conditonal Logic
let n = 7;
if (n <10) {
console.log("n is smaller than 10");
} else if(n < 20) {
console.log("n is smaller than 20");
} else {
console.log("n is greater than 10");
}
// for loop
for (let i=0; i<=10; i++) {
console.log(i);
}
// Another Way
let i;
for (i=0; i<=10; i++) {
console.log(i);
}
// ! Inro To Array in JS
/*
All Arrays are untyped,so you can put everything you want in an Array.
In addition to objects, the array data is ordered by indexes.
Arrays are actually objects, having the indexes (numbers from 0 to legnth - 1) as keys.
*/
// Creating Simple Array
let names = ['adib', 'sajib', 'jubayer', 'abir'];