Day 3 at payilagam "About python and first program in python

Day 3 at payilagam "About python and first program in python

Publish Date: Apr 2
1 0

For commenting a line we should use # before the line the python intrepreter doesn't consider it as code.

Python is
--> portable
--> multi - paradigm language
--> procedural oriented - eg : C
--> modular programming - Modula 3
--> Object Oriented Programming - C++

What is a Function?

A Function is a Sequence of actions and Set of instructions with a name.
Ex:
attending_class:
Dress
Walking
entering
Sitting
Listening
Taking notes

Naming Convention for a function:

-->Function name should be meaningful: eg: Sit,Stand,abcd,pqrs.
-->Function should not be Noun,Should be Verb.
-->Should end with()
-->Function name start with small letter.

First program:

name = input()
print("Welcome to python", name)

output:
RAJA
Welcome to python RAJA
Enter fullscreen mode Exit fullscreen mode

~ --> tilde
`--->back ticks

Linux commands:
pwd --> public Working Directory
ls --> listing all files and folders in directory
ls-ll --> Long list
Directory means Folder in linux

Ctrl+l means clear in python or we can give clear command also.

cd means change directory in linux

cd . . means back to previous directory

uparrow means enter

. --> current directory
.. --> previous directory

Task:
What is function? in python
A function in Python is a block of reusable code that performs a specific task and can take inputs, known as parameters, and return outputs. Functions are defined using the def keyword followed by the function name and parentheses containing any parameters.

What is variable in python?
In Python, a variable is a symbolic name that refers to a value stored in memory, allowing you to store and manipulate data. Variables are created by assigning a value using the equals sign (e.g., x = 5), and they can hold different types of data without needing explicit type declaration.

Comments 0 total

    Add comment