❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Important topics in CSS

25 June 2025 at 17:36

Hello everyone! Welcome to my blog. Today we are going to explore some most important topics in CSS.

1. Box model:
In CSS all the HTML elements are considered as box model. The Box Model in CSS is a fundamental concept that explains how HTML elements are rendered on a web page. Every element in a webpage is treated as a rectangular box, and the box model defines the structure of that box.

Image description

2. CSS selectors:
CSS selectors are patterns used to select and style the HTML elements you want to apply styles to. They are the most basic part of CSSβ€”you use them to target specific elements on a page.

  • Class selector
  • ID selector
  • Element selector
  • Combination selector, etc.

3. CSS position:
The position property in CSS is used to control how an HTML element is placed on a webpage.By default, elements appear one after the other in the normal document flow. But when you use position, you can move elements anywhere on the screen β€” relative to the page, their parent, or even the screen itself.

Types of Position:

  • Static
  • Relative
  • Absolute
  • Fixed
  • Sticky

Image description

4. Flex and Grid:
Flexbox: Flexbox(Flexible Box) is a one-dimensional layout system β€” it helps you align items in a row or a column, especially when the size of items is dynamic or unknown.

When to use?

  • When you're laying out items in a single direction (row or column).
  • Ideal for navbars, menus, buttons, and simple alignment tasks.

Grid: CSS Grid is a two-dimensional layout system β€” it lets you layout items in rows and columns at the same time.

When to use?

  • When your layout is complex (like a website layout with header, sidebar, main, footer).
  • You want to control both rows and columns precisely.

Image description

5. Media query and Animation:
Media query: Media queries are a way to apply CSS only when a certain condition is true β€” like screen size, resolution, or orientation.
They’re essential for responsive design β€” so your site works well on all devices.
Parts:

  • @media – This tells the browser β€œStart a media query.”
  • Media Type – Like screen, print, all. Most common is screen.
  • Media Feature – Conditions like width, height, orientation, etc.
  • Logical Operators – Use and, or, not to combine conditions.

Animation: Animations let you change CSS properties over time β€” making your webpage look more dynamic or interactive.
Required:

  • animation-name – Refers to the @keyframes block.
  • animation-duration – How long the animation takes (e.g. 2s, 1.5s).
  • animation-timing-function – The speed curve (ease, linear, etc.).
  • animation-delay – How long to wait before starting.
  • animation-iteration-count – How many times to repeat (1, infinite).
  • animation-direction – normal, reverse, alternate.

That's it. When I am prepare for my interviews I found that these are the important topics in CSS. Moreover In my past two interviews they ask question in these topics as well. So I thought It would be great to share these with you.Thank you for reading this. I hope you like this. Will see you in my next blog

Prepare for these questions before you go to an interview!

20 June 2025 at 14:53

Hello everyone!
Welcome to my another blog...
Today, I planned to share with you 10 questions and their answers, which are very helpful for our interview preparation!

1. Tell me about yourself?
This question is depends on your personal information, like about schooling and college background, and skill sets. So you can draft your self-intro according to your preference.

2. Why are you interested in our company?
I am interested in your company because of its strong commitment to innovation and quality. Your focus on delivering excellent products and services aligns with my xxxxx & xxxxx skills.
Note*: Here is also I given you a basic template for this question. You can also add some specific details about that which company you are going to attend an interview for.

3. What is your salary expectation?
As a fresher, my focus is on gaining hands-on experience and contributing effectively to the team. Based on industry standards, the team. Based on industry standards, the average salary for this role ranges from β‚Ήxxx to β‚Ήxxx LPA. I am open to a competitive offer that reflects my skills, potential & the value I bring to the company.
Note*: This is for freshers.

4. What are your strengths?
My key strengths include being a quick learner and a keen observer, which allows me to adapt efficiently and grasp new concepts quickly. I have strong leadership qualities, enabling me to take initiative and guide teams effectively, while also being a collaborative team player who values cooperation and shared success.
Note*: This is for quick learning, Great observing, Leadership quality, and Teamwork ability skills. You can add some other technical skills also.

5. Why did you choose your career in IT?
I chose a career in IT because I’m deeply passionate about technology and how it transforms everyday life. I enjoy building intuitive digital experiences, which led me to specialize in xxxx and xxxx development. IT offers endless opportunities to learn, innovate, and solve real-world problems, which keeps me motivated. My curiosity and adaptability make this a natural and exciting path for me.

6. How do you stay updated with technology trends?
I stay updated with technology trends by actively participating in developer communities like xxxx and attending tech meetups such as xxxx. I also follow industry blogs, watch online tutorials, and explore new tools related to xxxx and xxxx development. This consistent learning habit helps me stay current, improve my skills, and stay inspired by innovations.

7. What are your weaknesses?
One area I’m actively working on is delegating tasks. Since I tend to take full ownership of a project, I sometimes try to handle everything myself. However, I've realized the importance of trusting teammates and distributing work efficiently. I’ve been improving this by practicing collaboration in group projects and tech meetups, which has helped me grow.
Note*: It’s always great to show self-awareness and a willingness to improve.

8. How do you prioritize your work?
I prioritize my work by first identifying tasks based on urgency and impact. I like to break larger goals into smaller, manageable steps, and I often use to-do lists or digital tools to stay organized. Time-sensitive tasks always come first, followed by tasks that align with long-term goals. I also review my progress regularly to adjust plans if needed. This helps me stay focused and deliver quality results efficiently.

9. Describe how you deal with conflicts in the workplace?
When conflicts arise in the workplace, I approach them calmly and with an open mind. I try to understand the other person's perspective first, then communicate my thoughts respectfully to find common ground. I believe in addressing issues early before they escalate, and I always prioritize the team’s goals over personal opinions.

10. Why should we hire you over other qualified candidates?
You should hire me because I bring a strong blend of technical skills and a deep passion for xxxx development. I'm a quick learner, a keen observer, and actively involved in tech communities, which keeps me updated and inspired. I balance leadership with teamwork, allowing me to adapt in dynamic environments. While I may be a fresher, my drive to grow and contribute meaningfully sets me apart. I'm fully committed to making a positive impact from day one.

So, these are the popular questions repeatedly asked by corporations. And also, these are basic templates, you can add whatever you want.
If I missed any important questions, let me know in the comments. It will help me too. I hope you like it. Will see you on my next blog.
*Reference: https://copilot.microsoft.com/chats/5PcmbYgrY1SNaZx9SHFDe

A intro for Ente Photos!

18 June 2025 at 15:56

Hi! everyone...
Welcome to my next blog.
Today is the first day i heard the word "Ente photos". So today's blog we will explore about that platform.

The meaning of the name:
"Ente" means "mine" in Malayalam.(Many of you already knew that) - It's your own secure gallery.

Key features:

End-to-End Encryption(E2EE)

  • The main feature of this platform is security. Our photos will encrypted.
  • Even their company server can't to see our data.
  • If the server is hacked ,our photos will remain unreadable.

Cross-Platform Access

  • It's available on Android,iOS,Web,Windows,Linux,macOS.
  • We can access our photos anywhere securely.

Family sharing

  • We can share our storage plan with up to 5 family members.
  • We can create shared albums with customized icon settings with full privacy.

On-Device AI Search

  • If we want search a photos in large set of photo collections we can search by objects,faces,places just like Google Photos.
  • But all AI runs on your device(no cloud processing = better privacy.)

Original Quality Uploads

  • Ente doesn't compress our images or videos for satisfying their servers.

Who made this?

  • This is built by a team based in Kerala, including ex-Google engineer Vishnu Mohandas.

  • By creating platform they gained international recognition for privacy and simplicity.

So this all about I prepared to tell you today's blog. For many details you can use this platform additional of Google Photos.
Download the app from https://ente.io

Thank you for read my blog guys! I hope you like it. We Will see in my next Blog.

Open source in my vision! Before and after knowing these things

14 June 2025 at 04:01

Welcome to my blog! I'm really happy to see you on my another blog also.

Before

In my college, my final semester also included a paper called 'Open-Source System'. I actually had good marks on that paper as well. But the knowledge about open-source is very basic, no! not basic also, it's like I really don't understand what open source is. The things I get into wrong or misunderstand about open-source are,

  • "Open source is a free resource." This means "we can use open-source without paying any amount". Actually, this is also a correct meaning, but that sentence is not meant to say this. So, what is the real meaning of this is I will let you know in the 'After' part.

  • "Open source is Linux only." I really believe that open-source is only about Linux. The only example I gave in my exams was Linux for open-source.

  • "Open source is a big corporation. Behind of that, there will be a big company environment." Now also, I can't believe that my understanding is wrong, there is nothing like that.

After

After knowing some of the things about open-source is mind-blowing. The things I gain some clear meaning of the things and the real truths are,

  • The real meaning of the "Open is a free resource" is that the source code of the resource is free, like anyone can access that code. We can
    edit, update, and share. The reason behind the free resource is, we want to learn something about that code and grow ourselves with the open-source community. An interesting fact is that we can also contribute to them. For contributing open-source community, we can build a strong foundation for our career.

  • Open source is not only about Linux, there are so many open sources are there. Example: Android, VS Code, Firefox, etc. Linux is a popular OS in open source. I will let you know about Linux briefly in my next blog.

  • There is no one behind the open source. there is a community called the open-source community is a group of people managing some things in a remote mode. Interesting is that there is no office for open-source. Can you believe this? actually, I can't. How just a community can manage also these things without a physical location? That is the community power. That community has people who do not expect a profit or income. They are passionate about building open-source software.

So these are the thing I really want to share with you guys! You may know these things. But this is new to me to know the different side of the tech world. So thank you for read my blog. I hope you like it!

What are the things I am facing as a new bee in Chennai?!

13 June 2025 at 03:13

Erode to Chennai!

There are many things that I face struggles for survival in Chennai.
In the beginning, I have to manage the feeling that I miss my hometown, and at the same time, accept the highly populated city. I am going to share a few problems that I am currently facing.

Home food
Till now, I did not value my home food or my hometown's style of food.
Here I am staying in a PG. They are Telugu people, so their food is also Telugu style. Literally, I can't eat the food they provide. Every day, I am searching for a new hostel or home food makers. Currently, I am convincing my mind that this situation is temporary, "it will change after u get a job and move into a new area."

Transportation
I didn't go anywhere till now in Chennai because of the traffic and lack of public transport. In my area metro is also not available nearby. If I plan to go by bus, I will be there half an hour late. So, I am simply sitting on my Hostel bed and scrolling the YouTube shorts.

Weather
Here, I can't feel the freshness of the bathing. Because after the shower, I immediately start sweating. Every day I am going to my class with my sweaty face, my mentor also asked about that yesterday. Actually, I have done my bachelor's degree in Coimbatore. Now, think about my situation. I enjoyed the breezy climate days in Coimbatore. Why am I saying this? There are only two months (March and May) when the weather is hot in Coimbatore.

So, these are my struggles in Chennai currently. Thank you for reading my blog. I'll let you know my upcoming blogs if I overcome these struggles or not and how I overcome them.

My First Week Learning Front-End Development: A Beginner's Experience

12 June 2025 at 02:33

Hi! everyone!
I'm just one week into my front-end development journey, and I wanted to share what I've learned, how it's going so far, and what I plan to do next. I hope this blog inspires and helps other beginners like me!

Why I choose Front-End Development

I've always been curious about how websites and apps are built, especially the designs and interactive parts. That's what led me to Front-end development. I love the idea of creating things people can actually see and use. My goal is to become a UI/UX developer, so front-end is my first step towards that dream.

What I Learned This Week

In the First week of course, I got introduced to the core building blocks of the web:

*HTML (HyperText Markup Language): *
I learned how to create the structure of a webpage using tags like <h1>, <p>, <a>, <div>, etc.

*CSS (Cascading Style Sheet): *
I explored how to add colors, fonts, spacing, and layout to a webpage using selectors, properties, and values.

*Basic layout techniques: *
I got a basic idea of to position elements using properties like padding and flex.

Resources and methods I used

These really helped me understand better:

  • Practice the code by using pen and paper.
  • Reading my running notes often.
  • Write blogs what I actually leaned each day.

What's next?

Next week, I'll be diving deeper into:

  • Creating a small project.
  • Use Linux OS often for better understanding about Open-source.

Final Thoughts

Start something new can feel overwhelming, especially in tech. But this first week showed me that ''Consistency is the key to Success''. Each day i learn something new, I'm one step closer to my goal.
If you're also learning front-end development or thinking about it, just start you don't need to know everything. Just be consistency.

Thanks for reading!
Feel free to connect with me or drop your tips for beginners in the comments.

Git

2 September 2024 at 13:32

Git is a powerful version control system which used to manage the code across multiple users and track changes across different versions.

Installation:

Download and install GIT from the below path

https://git-scm.com/download/win

Once installed, Git can be used as a version control system through various commands.
You can configure Git for a specific folder on your computer, allowing you to manage all changes to existing files and the addition of new files within that folder

Basic commands:

1. git init:

This will initialize new repository in the current directory. This also creates .git directory and store all version control information.

2. git config:
git config --global user.name "Ranjith "
git config --global user.mail "ranjith201099@gmail.com"
3. git status

Shows the current status of working area like staged, untracked and unstaged.

4. git add

add changes from working directory to the staging area, preparing them to commit.

To add specific file: git add "filename.py"
To add all changes git add .
5. git commit
git commit -m "<message>"

Commits the staged changes with descriptive mesage

6. git log

Displays the list of commit history for the repository.
It will show commit id, author, dates and commit changes
Creating a branch

git branch <branch_name> - to create branch
git checkout <branch_name> - to switch to the new branch
git branch -b <branch_name> 

to create and switch to branch
git branch - to view all the branches (current branch will be highlighted with asterisk)

Merge a branch:

Once completed work on a branch and want to integrate it into another branch (like master), merging comes to place.

It means all the changes we have made in <branch_name> will be merged with master branch.
First, switch to the branch you want to merge into: git checkout master
Then, use git merge <branch_name> to merge your branch.
Deleting branch
Once the code changes in <branch_name> merged into <master> branch, we might need to delete branch.
use git branch -d <branch_name> to delete branch

Image description

Image description

js | Functions |

31 August 2024 at 16:16

Functions

Functions are pieces of code that we can reuse again and again in our code

Function Declaration - JavaScript Hoisting

syntax:
function functionName( ){

// code block

}

functionName()  //calling function
Example:
function msg( ){

console.log("Hii...Hello");

}

msg()  //calling function
//msg()
output:

Hii...Hello
//Hii...Hello

A function declaration defines a named function.It's hoisted,
meaning you can call it before it's defined.

Calling the function:
HOSTING
msg()  // valid  HOSTING
function msg( ){

console.log("Hii...Hello");


}
output:

Hii...Hello

Function Parameters and Arguments

syntax:

                        //input 
function functionName( parameter ){

// code block   //output

}

functionName( arguments)  //calling function

Functions can take parameters, which act as placeholders for the values
that will be passed to the function.The passing value is called an argument.

function msg( name ){

console.log("Hii...Hello" + name);

}

msg( "ranjith") ;
msg( "kumar") ;


output:

Hii...Hello ranjith
multiple parameters
function msg( name ,age){

console.log("Hii", + name +" my age"+age);

}

msg( "ranjith",25) ;
msg( "kumar",20) ;

Default Parameter

function printer(color){

console.log("print document in ${color} color");

}

//printer("blue") 
printer("blue") 
output:

document coloe blue color
//red override
function printer(color="black"){

console.log("print document in ${color} color");

}

//printer("red") 
printer( ) 
output:

//document coloe red color

document coloe black color

 Function with Return Type
function add( a,b){
     return a+b;

}

 let sum = add(10,20); //variable vechu assign panni print pannrom
 console.log(sum);  //30

 //console.log(add(10,20);   check pls
 Function Expression
A function expression defines a function inside an expression.
It's not hoisted, so you can't call it before it's defined.
syntax:

    variable      keyword
let functionName=function ( ){

   //code block

}

functionName()   // calling function

Ex:

           //don't change 
 let msg = function( ){   // function() indha typelaa kandippa irukkanum

 console.log("good morning");

}

msg( ) ;  //good morning 
With Argument
//msg( "ranjith") ;   // exp not hositing

let msg = function( name ){

console.log("good morning ${name}");

}

msg( "ranjith") ;  //good morning ranjith
Function Expression with Return Type
let mul = function (a,b){
   return a*b;

};

let result = mul( 5,2 ){
console.log(result); //10

 //console.log(mul(4,7));
 Arrow Function
 Arrow functions provide a concise syntax and do not bind their own 'this'. They are not hoisted.
 syntax:


    variable      keyword
let functionName=( ) =>{

   //code block

}

functionName()   // calling function

Example:
let evening = ( ) =>{

 console.log("good evening everyone");

}

evening ()   // good evening everyone 
With Argument
//not hoisting
let evening = ( name ) =>{

 console.log("good evening " + name);

}

evening ("ajith")   // good evening ajith
 Arrow Function with Return Type


 let sub =( a,b ) =>{
    return a - b ;
 };

  console.log( sub(10,6); // 4
Shorter Way
let sub =(a,b) => a-b;

console.log(sub(10,6)); //4
Function Calling Other Function
                       //ranjith
 function welcomeShopper(name){

 console.log(" welcome ${name} ! enjoy yoyr shopping experience")

}              //ranjith
    function main(name){

   // welcomeShopper(name); // direct calling
                   //ranjith
   let ShopperName-name;  // variableassign and after calling
                   //ranjith
   welcomeShopper(ShopperName); // calling top welcomeshopper

  };

  main("ranjith")  // welcome ranjith ! enjoy your.....
Anonymous Functions: Later on Course on Arrays
serTimeout(() => {

   console.log(" anonymous function executed");

 },2000 // 2sec delay  

 output: anonymous function executed
Scope of variables will on functions and loops
var: Function scoped.
Ex:
function demo(){
    var a =20;
    console.log(a); 

  }
demo();
console.log(a)  //error function outside calling
let: Block scoped.
const: Block scoped.
 Ex:

 function demo(){
     var a =20;
     console.log(a); 

   if (true){

   var x = "var";
   let y = "let";
   const z = ""const;     /// block scop

   console.log(x);
   console.log(y);    // all working good ...if block
   console.log(z);

  }
   console.log(x); // outer block code run successfully  (var)   
   console.log(y);   // error  (let)
   console.log(z);   // error not defienfd  (const)

 demo();

console.log(a)

Js | Truthy & Falsy |

31 August 2024 at 09:48

Truthy and Falsy Values:

in Javascript, truthy and falsy values are used to determine whether a value evaluate to true or false in a boolean
context.this concept is crucial for controlling the flow of your program using conditions like if statement.

Falsy Values: 0," ",null,NaN,false,undefined 
console.log(Boolean(0)); //false
console.log(Boolean(undefined)); //false

console.log(Boolean(' '));  //empty false

console.log(Boolean(null)); //false

console.log(Boolean(NaN)); //false not a number

console.log(Boolean(false)); //false

Truthy Values: any value that is not Falsy :

console.log(Boolean(1)); //true
console.log(Boolean(1833933)); //true
console.log(Boolean(-1)); //true
console.log(Boolean("hello")); //true
console.log(Boolean(1)); //true
console.log(Boolean([])); //true empty array
console.log(Boolean({})); //true empty object
console.log(function (){}); //true
Example:
           t     f
let cash =255  //0 ; 
    //conditions false  statement block not run
if (cash){
  console.log("you can buy burger with drink"); 
}else{
   console.log("you can buy burger"); 
}else{
   console.log("you don't have money"); 
}
let a;
console.log(a); //false
output:
undefined 
let a = 10;
console.log(a); //true
let a = null;
console.log(a); //false

Js | Decision Making: | if | if Else | Else if |

31 August 2024 at 09:15

Decision Making: if, if...else, else if


Decision making or control flow in programmming is the way we coontrol the execution
of code based on certain conditions.this allows the program to make choicces and execute diff code paths.

Example 1: if statement
syntax:
if (condition){

  //code block 

}

Example:

             f    f   t
let temp =  #24  #25  25;


if (temp>=25);
{

console.log("it is hot outside");

} 

Example 2: if...else statement

syntax:

if (condition){

  //code block 

}
else{

   //code block 

}
Example 1:
if (temp>=25);

{

console.log("it is hot outside");

}
else{

console.log("it is cold outside");

}
Example 2:
let isRaining= #true false;

if (isRaning);
{

console.log("take an umbrella");

}
else{

console.log(" you don't need an umbrella");

}
Example 3: else if statement
syntax:
if (condition){

  //code block 

}
else if(condition){

   //code block 

}
else{

   //code block 

}
Example:
let time=14;

if (time<12){

console.log("good morning"); 

}
else if(time<18){

 console.log("good afternoon");  

}
else{

 console.log("good evening");  

}
Example 4: Nested if statements
Variables
let age= 16;
let iswithparents=true;
let idproof=true;
Decision logic

if (age>=18);{

  if(idproof);
    console.log("you can visit the mall and can able to watch the movie"); 
  } else{
     console.log("you can visit te mall"); 
  }
}else{
     if(iswithparents);
        console.log("you can visit the play area"); 
  } else{
     console.log("you are not allowed in the play are"); 
  }

}
Example:
let day=1;

if(day===1){
  console.log("monday"); 
}
else if(day===2){
  console.log("thuesday"); 
}
else if(day===3){
  console.log("wenday"); 
}
else if(day===4){
  console.log("thuesday"); 
}
else if(day===5){
  console.log("friday"); 
}
else{
console.log("in valid"); 
}
Switch Statement
syntax:
switch(vale){
  case 1:
     //code block  
      break;
  case 2:    
    //code block  
       break;
  case 3:
      //code block  
       break;
  Default:
      //code block  
       break;
}
Exmple1:
let day=3;

switch(day){

  case 1:
      console.log("monday"); 
      break;
  case 2:
      console.log("thuesday"); 
      break;
  case 3:
      console.log("wensday"); 
      break;
  case 4:
      console.log("thresday"); 
      break;
  case 5:
      console.log("friday"); 
      break;
   default:
      console.log("invalid"); 
}

output:

wensday
Exmple2:
let choice='tea';

switch(choice){

   case 'coffee':
      console.log("you choose coffee monday"); 
      break;
   case 'tea':
      console.log(" you choose tea thuesday"); 
      break;
    case 'water':
      console.log(" you choose water thuesday"); 
      break;
    default:
      console.log("invalid"); 
}

output:

you choose tea 
Ternary Operator
short hand if else
let isadmin =true;

/*if(isadmin){
  console.log("am  admin");
}
else{
   console.log("am  user");
} */
                 true        .
let userrole = isadmin ? " am admin ":" am user ";
console.log(userrole);

let mark=60;
     var        cond      if       else
let result = mark>=30 ? " pass ":" fail ";
              //true
//let result = 25>=30 ? " pass ":" fail ";

console.log(result); 

output:

pass

Js | DataTypes |

30 August 2024 at 18:13

Datatypes

  • Javascript is Dynamic Typing

  • Primitive and Object Type

Primitive Data Types:

1.Number - Represents both integer and floating-point numbers.

let age=10;  #equal two apram enna num,str,bool ex...automatic convert pannikum enna datatype nu.
console.log(age);
console.log(typeof age); 

output:
10
number
age="25";
console.log(age);
console.log(typeof age); 

output:
string

float number:

let price=19.99;
console.log(price);
console.log(typeof price); 

output:
19.999
number

2.String - Represents a sequence of characters.

let greeting="Hello World.!"
console.log(greeting);
console.log(typeof greeting); 

output:
string

3.Boolean - Represents a logical entity and can have two values: true or false.

let isActive=true;
console.log( isActive);
console.log(typeof  isActive);
let isActive=false;
console.log( isActive);
console.log(typeof  isActive); 

4.Undefined - A variable that has been declared but not assigned a value.

let name;  #Error undefined
console.log( a);
console.log(typeof a); 

5.Null - Represents the intentional absence of any object value.

let name-null:
console.log(name);
console.log(typeof name); 

6.Symbol - Represents a unique and immutable value, often used as object property keys.

let unique=symbol("key"); #custom symbol
console.log(unique);
console.log(typeof unique); 

output:
symbol("key")

7.BigInt - Represents whole numbers larger than 2^53 - 1 (the largest number JavaScript can reliably represent with the Number type).


let largeNumber=BigInt(68690356789000833);
let largeNumber=68690356789000833n; #using the n notation

console.log( largeNumber);
console.log(typeof largeNumber); 

output:
68690356789000833n

Non-Primitive Data Types

1.Object

Represents a collection of properties, each consisting of a key (usually a string)
and a value (which can be any data type, including another object.

let person={

  name-'ranjith'.
  age=25,
  isEmployed=true;
}

console.log( person); //total laa print agum
console.log( person .name);  // name only
console.log( person .age);  // age only
console.log( person .isEmployed);

console.log(typeof  person); 

2.Array

A special type of object used for storing ordered collections of values.

let number=[1,2,5,4,8];
console.log( number);

let mixdata=[1,'2',true,false,null,[1,2,'5',"str"] ,undefined ];
console.log( mixdata);

3.Function

A special type of object that is callable and can perform an action.

function invite( ){
   console.log( "you are invitd");
}
invite()
**4.Date - A built-in object for handling dates and times.**

let now- new Date;
console.log( now);

outut:
date wed jul 24 2024 09.00:51 Gmt( indian stamdard)

Js | Variable & Values |

29 August 2024 at 13:15

Jscript print :

console.log("Hello World ");

Variables & Values

Image description

Image description

  • The var keyword was used in all JavaScript code from 1995 to 2015.

  • The let and const keywords were added to JavaScript in 2015.

  • The var keyword should only be used in code written for older browsers.

Java script identifiers :

  • All JavaScript variables must be identified with unique names.

  • These unique names are called identifiers.

  • Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume).

  • The general rules for constructing names for variables (unique identifiers) are:

  • Names can contain letters, digits, underscores, and dollar signs.

Names must begin with a letter.

Names can also begin with $ and (but we will not use it in this tutorial).

Names are case sensitive (y and Y are different variables).

Reserved words (like JavaScript keywords) cannot be used as names.

What is Good?

- let and const have block scope.

- let and const can not be redeclared.

- let and const must be declared before use.

- let and const does not bind to this.

- let and const are not hoisted.

What is Not Good?

- var does not have to be declared.

- var is hoisted.

- var binds to this.

Declare var variable :

var a; #Error undefined 

Initialize the variable :

var a = 10;

Redeclaration allowed :

var a = 100;
console.log(a);

Output :
100

Declare let variable :

let b;

Initialize the variable :

let b = 10;

Redeclaration is not allowed :

let b =100; 

Reassignment is allowed :

b = 200;
console.log(b);

cons must Declare & initialize 1st line :

const PI=31415 ;
//fixed Value Called Constant
console.log (PI);

Reassignment is not allowed :

const c = 1;
c = 2;
console.log(c);

Naming conventions :

correct way :

Correct camel Case convention :
let userName = 'John'; 
Underscore is not recommended but valid :

let user_Name ='Max'; 
start from Underscore :

let _userName ='Doe'; 

start from dollar symbol :

let $userName='Evo' ; 

string concatenate :

console.log('Welcome + userName);
console.log("Hi + userName);
console.log('Bye + userName);

Incorrect variable names :

Invalid: variable names cannot start with a number

let 5date= 5;

Resrved keywords (Functions):

let new = "data";
let function = 20;

Symbols in variable names :

let #function = 'data'; 
let @function = 'data';
let John&Jane = 'Friends'; 

let $function = 'data';  
#this one is correct

Scope of variables will on functions & loops :

var: Function scoped.
let: Block scoped.
const: Block scoped 

Python - List Methods & Tasks II

By: SM
1 August 2024 at 01:22

Even though I had done the tasks beforehand, watching them being done in class today taught me new things.

I learned that I could use Python's in-built list methods more, instead of falling back to for loop all the time.

For example, I could use the extend method (rather than for loop and append method) to expand a list with the contents of another list. Likewise, I could use the clear method (rather than for loop and remove method) to empty a list.

Unless there is a specific need for using the for loop, like I need to check a condition on individual elements before adding them to or removing them from the list, the code looks much cleaner this way.

Python: print() methods

17 July 2024 at 10:58

Hi all,
Today, I learned about the Python print statement. It is fascinating to know that Python has so much functionality.I will share some of the thing i learned today

  1. sep, the sep parameter is used with the print() function to specify the separator between multiple arguments when they are printed.
  2. escape sequence like \n (new line), \t(adds space), \b(removes previous character).
  3. concatenation which adds two different strings.
  4. concatenating str and int which combine string and integer by converting integer into string by typecasting.
  5. Raw string A raw string in Python is defined by prefixing the string literal with an 'r' or 'R'.Raw strings are often used when working with regular expressions or when dealing with paths in file systems to avoid unintended interpretation of escape sequences.
  6. Format the format() method is used to format strings by replacing placeholders {} in the string with values passed as arguments.
  7. string multiplication here you can multiply strings by using the *operator. This operation allows you to multiply string a specified number of times.

Python - Indexing and Slicing

By: ABYS
24 July 2024 at 14:59

Indexing & Slicing is an important concept in Python, especially when we use strings.

Indexing :

WKT, string is nothing but a sequence of characters.
So, each character has a position namely index and accessing their position in that particular string is known as indexing.

In Python, we have zero based indexing i.e., the first character of a string has an index(position) of 0 rather than having one, then the second character has an index(position) of 1 and so on.

For example,

>     H E L L O W O R L D
>     0 1 2 3 4 5 6 7 8 9

This is known as positive indexing as we have used only positive numbers to refer the indices.

You may ask that "Then, we have negative indicing too??"
Ofc, but in here we do not have zero as the first position as it ain't a negative number.

Negative indexing allows us to access characters from the end of the string i.e., the last character has an index of -1, the second last character has an index of -2, and so on.

>      H  E  L  L  O  W  O  R  L  D
>    -10 -9 -8 -7 -6 -5 -4 -3 -2 -1
word = "HELLOWORLD"

print(word[0])
print(word[5])

H
W

Similarly,

print(word[-1])
print(word[-6])

D
0

That's it about indexing.

Slicing :

Think of slicing a string like cutting a slice of cake from a whole cake. We can specify where to start cutting (index), where to finish (end index), and even how big each slice should be (step). This way, we can create smaller portions of the cake (or string) exactly how we like them!

In Python, slicing a string lets us grab specific parts of it by specifying where to start and where to end within the string.
So, for instance, if message contains "HELLOWORLD", then message[3:7] gives you "LOWO" because it starts at index 3 ('L') and ends just before index 7 ('D'). This way, we can extract any part of a string we need!

- The basic syntax for slicing is,

string[start:stop]
  • The start index is where the slice begins, and this index is inclusive.
  • The stop index is where the slice ends, but this index is exclusive, meaning the character at this index is not included in the slice.
text = "HappyBirthday"

print(text[0:5])  
print(text[5:13])

Happy
Birthday  

When slicing a string in Python, we can simply omit the start or stop index to slice from the beginning or to the end of the string.
It's as straightforward as that!

- Slicing with a step,

To specify the interval between characters when slicing a string in Python, just add a colon followed by the step value:

string[start:stop:step]

This allows to control how we want to skip through the characters of the string when creating a slice.

message = "HELLOWORLD"
print(message[1::2])    

EORL

message[1::2] starts slicing from index 1 ('E') to the end of the string, with a step of 2.
Therefore, it includes characters at indices 1, 3, 5, and 7, giving us "EORL".

Until, we saw about positive slicing and now let's learn about negative slicing.

- Negative Slicing :

  • A negative step allows you to slice the string in reverse order.
  • Let us slice from the second last character to the third character in reverse order
message = "HELLOWORLD"
print(message[-2:2:-1])

ROWOL

Let's look into certain questions.

#Write a function that takes a string and returns a new string consisting of its first and last character.

word = "Python"
end = word[0]+word[5]
print(end)

Pn

#Write a function that reverses a given string.

word = "Python"
print(word[::-1])

nohtyP

#Given a string, extract and return a substring from the 3rd to the 8th character (inclusive).

text = "MichaelJackson"
print(text[3:9])

haelJa

#Given an email address, extract and return the domain.

email = "hello_world@gmail.com"
domain = email[:-10]
print(domain)

hello_world

#Write a function that returns every third character from a given string.

text = "Programming"
print(text[::3])

Pgmn

#Write a function that skips every second character and then reverses the resulting string.

text1 = "Programming"
print(text1[::-2])

gimroP

#Write a function that extracts and returns characters at even indices from a given string.

text = "Programming"
print(text[::2])

Pormig

Allright, that's the basic in here.

.....

Python - Functions

By: ABYS
19 July 2024 at 11:24

FUNCTIONS, an awesome topic I learnt today. It's a shortcut for all lazy i.e., smart people who don't wanna waste their time typing inputs for several times.

What Is a Function?

In programming, rather than repeatedly writing the same code , we write a function and use it whenever and whereever it is needed.
It helps to improve modularity, code organization and reusability.

So, now let's see how to create a function.
A function contains,

  • function name - an identifier by which a function is called
  • arguments - contains a list of values passed to the function
  • function body - this is executed each time the function is called function body must be intended
  • return value - ends function call and sends data back to the program
def function_name(arguments): # key function name(arguments)
  statement                   # function body
  statement

  return value                # return value

Some examples of how to use functions.

#Write a function greet that takes a name as an argument and prints a greeting message.

def greet(name):
    return(f"Hello, {name}!")
greet("ABY")

Hello, ABY!

Here, we can replace return by print too.

#Write a function sum_two that takes two numbers as arguments and returns their sum.

def sum_two(a,b):
    return a+b

result = add(3,7)
print(result)

10

#Write a function is_even that takes a number as an argument and returns True if the number is even, and False if it is odd.

def is_even(num):
    return num % 2 == 0

num = 5
print(is_even(num))

False

#Write a function find_max that takes two numbers as arguments and returns the larger one.

def find_max(a,b):
    if a > b:
      return a
    else:
      return b

print(find_max(7,9))

9

#Write a function multiplication_table that takes a number n and prints the multiplication table for n from 1 to 10.

def multiplication_table(n):
    for I in range (1,11)
    result = n * i 

print(f"{n} * {i} = {result}")
n = multiplication_table(int(input("Enter a no: ")))

and the result is,

Enter a no: 5 # I've entered 5
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50

#Write a function celsius_to_fahrenheit that takes a temperature in Celsius and returns the temperature in Fahrenheit.

This is how we normally do it..

celsius1 = 27
fahrenheit1 = (celsius1 * 9/5) + 32
print(f"{celsius1}Β°C is {fahrenheit1}Β°F")

celsius2 = 37
fahrenheit2 = (celsius2 * 9/5) + 32
print(f"{celsius2}Β°C is {fahrenheit2}Β°F")

celsius3 = 47
fahrenheit3 = (celsius3 * 9/5) + 32
print(f"{celsius3}Β°C is {fahrenheit3}Β°F")

27Β°C is 80.6Β°F
37Β°C is 98.6Β°F
47Β°C is 116.6Β°F

It's cumbersome right??
Soo, what's the shortcut? Ofc using a function.

def celsius_to_fahrenheit(celsius):
  return (celsius * 9/5) + 32

celsius = float(input("Celsius: "))
fahrenheit = celsius_to_fahrenheit(celsius)
print(f"{celsius}Β°C is {fahrenheit}Β°F")

Celsius: 37.5
37.5Β°C is 99.5Β°F

I've used input function to make it more compact...

#Write a function power that takes two arguments, a number and an exponent, and returns the number raised to the given exponent. The exponent should have a default value of 2.

def pow(num,exp = 2):
  return num ** exp


result = pow(5,exp = 2)
print(f"The number {num} raised to power 2 is ",{result})

You can opt to use input fns and variables as well..

By now, it's understandable that for one problem we can use multiple
programs to solve it. It depends which we prefer to use.

.....

My First Blog _Python

By: ABYS
16 July 2024 at 08:39

Hi All,

This is my very first blog. I'm a Biomath student who has zero knowledge about computer related stuffs.
Later, I was convinced to study a programming language yet confused with how,where and what to start...?

And finally decided to learn python, as people around me implied that it's easy to start with... So, now I'm learning python from an online platform., which teaches me so fine...

I thought of blogging it all, cause people like me will get to know that python isn't overly challenging rather as simple as English grammar.

We can learn python just by using "Google Colaboratory", yet I would let u know how to install python later.

So, join with me...
Let's start to learn PYTHON

PYTHON BASICS

1. Printing a String :

  • To print a text, we use print function - print()

  • Let's begin with "Hello World".

  • By writing certain text within the print function inside double or single quotes, we get :

print("Hello World")

Hello World

2. Similarly, we can Print Variables :

  • Variables are used to store data.
name = "Abys"
print(name)

Abys

  • Here, if we give numbers as values for the variable (ex: age=25) we needn't provide them under double or single quotes as they give the same output but as for texts we should use "" or ''.
age = 25 
print(age)

25

age = "25"
print(age)

25

name = Abys
print(name)

Traceback (most recent call last):
  File "./prog.py", line 4, in <module>
NameError: name 'Abys' is not defined

  • That's the reason for this rule. Hope it's clear.,

3. Printing Multiple Items :

  • We can print multiple items by separating them with commas while python adds space between each item.

  • Formatting strings with f strings is another sub topic where we insert variables directly into the string by prefixing it with an f and using curly braces {} around the variables.

let's see both,

name="Abys"
age=17
city="Madurai"
print("Name:",name , "Age:",age , "City:",city ,end=".")

Name: Abys Age: 17 City: Madurai.


name="Abys"
age=17
city="Madurai"
print(f"Name:{name},Age:{age},City:{city}.")

Name:Abys,Age:17,City:Madurai.

4.Concatenation of Strings :

  • Here, we connect words using + operator.
w1="Sambar"
w2="Vada"
print(w1+" "+w2+"!")

Sambar Vada!

  • Let's also see what is Printing Quotes inside Strings.

  • To print quotes inside a string, we can use either single or double quotes to enclose the string and the other type of quotes inside it.

w1="Sambar"
w2="Vada"
print("I love" , w1+" "+w2+"!")

I love Sambar Vada!

hobby = "Singing"
print("My hobby is" , hobby)

My hobby is Singing

5.Escape Sequences and Raw Strings to Ignore Escape Sequences :

  • Escape sequences allows to include special characters in a string. For example, \n adds a new line.
print("line1\nline2\nline3")

line1
line2
line3

  • r string is used as prefix which treats backslashes as literal characters.
print(r"C:\Users\Name")

C:\Users\Name

6.Printing Results of Mathematical Expressions :

  • We've already seen how to print numbers.
print(26)

26

  • Now, we're going to print certain eqns.
print(5+5)

10

print(3-1)

2

that's how simple it is...

7.Printing Lists and Dictionaries :

  • We can print entire lists and dictionaries.
fruits = ["apple", "banana", "cherry"]
print(fruits)

['apple', 'banana', 'cherry']

8.Using sep and end Parameters :

  • The sep parameter changes the separator between items.

  • The end parameter changes the ending character.

print("Happy", "Holiday's", sep="-", end="!")

Happy-Holiday's!

  • Let's see how to print the same in adjacent lines, here we use either escape sequences (\n) or Multiline Strings.

  • Triple quotes allow you to print multiline strings easily.

print("""Happy
Holiday's""")

print("Happy\nHoliday's")

both gives same output as :

Happy
Holiday's

9.Combining Strings and Variables :

  • Combining strings and variables by using + for simple cases or formatted strings for more complex scenarios.

  • For simple case:

colour = "purple"
print("The colour of the bag is "+colour)

The colour of the bag is purple

  • For complex case :
temperature=22.5
print("The temperature is", str(temperature),"degree Celsius",end=".")

The temperature is 22.5 degree Celsius.

10.Printing with .format() and Using print for Debugging:

  • Use the .format() method for string formatting.
name="Abys"
age=17
city="Madurai"
print("Name:{}, Age:{}, City:{}".format(name,age,city))

Name:Abys, Age:17, City:Madurai

  • We can use print to debug your code by printing variable values at different points.
def add(a, b):
    print(f"Adding {a} and {b}")
    return a + b

result = add(1, 2)
print("Result:", result)

Adding 1 and 2
Result: 3

That's it.
These were the topics I learned in my 1st class.

At the beginning, I was confused by all the terms but as time went I got used to it just like we first started to learn English.

Try it out yourself... as u begin to get the output., it's next level feeling.
I personally felt this;
"Nammalum Oru Aal Than Pola"...

.....

8.Python Loops

24 July 2024 at 12:47

Python Loops:

Python has two primitive loop commands:

while loops
for loops

while Loop:

With the while loop we can execute a set of statements as long as a condition is true.

i = 1
while i < 6:
  print(i)
  i += 1

Output :

1
2
3
4
5

For loop:

A "For" Loop is used to repeat a specific block of code a known number of times

`fruits = ["apple", "banana", "cherry"]
for x in fruits:
  print(x)

Output :
apple
banana
cherry`

Type of Loops:

For Loop:

A for loop in Python is used to iterate over a sequence (list, tuple, set, dictionary, and string). Flowchart.

While Loop:

The while loop is used to execute a set of statements as long as a condition is true.

*Nested Loop : *

If a loop exists inside the body of another loop, it is called a nested loop.

❌
❌