0% found this document useful (0 votes)
23 views3 pages

Coding Basics Notes

Uploaded by

lavilavinesh99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Coding Basics Notes

Uploaded by

lavilavinesh99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Coding Basics Notes for Beginners

What is Coding?

Coding is giving instructions to a computer using a programming language.

Example:

print("Hello, world!")

Variables

Used to store data.

Example:

name = "Sakinthan"

age = 20

Data Types

String: "hello"

Integer: 5

Float: 3.14

Boolean: True or False

Operators

Used for calculations:

a=5+3

b=6*2

c = 10 / 2

Input and Output

Take input from the user and print output:

name = input("Enter your name: ")

print("Hello", name)
Coding Basics Notes for Beginners

If-Else Conditions

age = 18

if age >= 18:

print("You are an adult")

else:

print("You are a minor")

Loops

While loop:

count = 1

while count <= 5:

print(count)

count += 1

For loop:

for i in range(5):

print(i)

Functions

Reusable block of code:

def greet(name):

print("Hello", name)

greet("Sakinthan")

List (Array)

Store multiple values:

fruits = ["apple", "banana", "mango"]

print(fruits[0]) # Output: apple


Coding Basics Notes for Beginners

First Web Page (HTML)

<!DOCTYPE html>

<html>

<head>

<title>My First Page</title>

</head>

<body>

<h1>Hello World!</h1>

<p>This is my first website.</p>

</body>

</html>

You might also like