Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
15 views

Python Coding

python information
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Python Coding

python information
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Key Terms

● Programming code - Programming code, also known as source code or


scripts, consists of written instructions in a computer programming
language. These instructions are structured according to specific rules and
guide computers in performing tasks. It can be likened to a detailed recipe
for computers.

● Programming languages - Similar to human spoken languages,
programming languages utilize syntax and semantics. They are used to
create computer programs. Examples include Python, Java, C, C++, C#, and
R.

● Syntax - Syntax in programming refers to the rules governing the structure
of statements. It dictates the order of elements, use of special characters,
and their placement within instructions. This concept parallels the rules for
grammar and punctuation in human languages.

● Semantics - Semantics pertains to the meaning or intended effect of
statements in both human and computer languages. Errors in semantics,
known as logical errors, can cause programs to function incorrectly.

● Computer program - A computer program is a sequence of instructions that
directs a computer on how to achieve a specific goal. Programs can be
extensive and perform a wide range of tasks. They are typically developed
by programmers and software engineers and are often compiled into a
single executable file.

● Script - Scripts are generally shorter and less complex than full computer
programs. They are commonly used to automate specific tasks but can
handle more complex operations when necessary. Scripts have a less
structured development cycle compared to programs and can be written in
languages like Python, JavaScript, Ruby, and Bash.

● Automation - Automation involves replacing repetitive manual processes
with automated ones, streamlining efficiency and reducing human error.

● Output - Output is the result produced by a program or function after
processing input. It can range from a single value to reports or database
entries.

● Input - Input refers to data or information provided to a program by users.
It can include text, voice, images, biometrics, etc.

● Functions - Functions are reusable blocks of code designed to perform
specific tasks. They enhance code modularity and readability by
encapsulating functionality.

● Variables - Variables are used to store data temporarily within a program.
They allow for dynamic manipulation of data during execution.

A code example

friends = ['Taylor', 'Alex', 'Pat', 'Eli']


for friend in friends:
print("Hi " + friend)

x+y Addition + operator returns the sum of x plus y


x-y Subtraction - operator returns the difference of x minus y
x*y Multiplication * operator returns the product of x times y
x/y Division / operator returns the quotient of x divided by y
x**y Exponent ** operator returns the result of raising x to the power of y
x**2 Square expression returns x squared
x**3 Cube expression returns x cubed
x**(1/2) Square root (½) or (0.5) fractional exponent operator returns the
square root of x
x // y Floor division operator returns the integer part of the integer
division of x by y
x%y Modulo operator returns the remainder part of the integer division
of x by y
—------------------------------------------------------------------------------------------------
------------------

print(“hello world : “)

Print is a function
Hello world is a text that will come on the screen making it a
string which is always written in quotations

int() = integers
str() = words
float() = decimal points
bool() = when a data type has one of two possible values

Comparisons signs
< smaller than
> greater than
<= smaller than or equal to
> greater than or equal to
== same
!= different

Logical Operators It with come true if


and both
or one
not Inverse

You might also like