Looks like no one added any tags here yet for you.
The University of Texas at Dallas
A public research university located in Dallas, Texas.
Data Types
A classification of data that determines the type of values that can be stored and manipulated within a program.
print()
A function in Python used to display output on the console or terminal.
Examples of constants in Python:
PI: Represents the ratio of a circle's circumference to its diameter.
True/False: Boolean constants for truth values.
None: Special constant for absence of value.
MAX_INT: Constant for maximum integer value.
MIN_FLOAT: Constant for minimum floating-point number value.
Examples of constants:
The speed of light in a vacuum (c)
The gravitational constant (G)
Avogadro's number (N_A)
Planck's constant (h)
The gas constant (R)
The value of pi (π)
Euler's number (e)
The golden ratio (φ)
Boltzmann's constant (k)
The fine-structure constant (α)
global
A keyword used to declare a global variable.
not
A logical operator used to negate a condition.
with
A keyword used to define a context manager.
as
A keyword used for aliasing or renaming variables.
elif
A keyword used in conditional statements as an alternative to "else if".
if
A keyword used to define a conditional statement.
or
A logical operator used to combine conditions with an "or" relationship.
yield
A keyword used in generator functions to return a value.
assert
A keyword used for debugging purposes to check if a condition is true.
else
A keyword used in conditional statements as a fallback option.
import
A keyword used to import modules or libraries in Python.
pass
A keyword used as a placeholder for empty code blocks.
break
A keyword used to exit a loop prematurely.
except
A keyword used to catch and handle exceptions.
in
A keyword used to check if an element is present in a sequence.
raise
A keyword used to raise an exception manually.
class
A keyword used to define a class in object-oriented programming.
finally
A keyword used in exception handling to define a block of code that will always execute.
is
A keyword used to check if two objects are the same.
return
A keyword used to return a value from a function.
continue
A keyword used to skip the rest of the current iteration in a loop and move to the next one.
for
A keyword used to iterate over a sequence or collection.
lambda
A keyword used to define anonymous functions.
try
A keyword used to define a block of code to be tested for errors.
def
A keyword used to define a function.
from
A keyword used to import specific attributes or functions from a module.
nonlocal
A keyword used to declare a variable in an outer (but non-global) scope.
while
A keyword used to define a loop that continues as long as a condition is true.1. Variables:A name place in memory where data (value or constant) is stored. We can call the data by using its name. The data can be changed later. Variable names are not repeated.
x
A variable with a value of 5.
temperature
A variable with a value of 70.
pi
A variable with a value of 3.14.
X
A variable with a value of 7.1. Variables in Python:Containers used to store data values in a program.
Variable names (identifiers)
Names given to variables to identify and access them.
Must start with a letter (or_)
Variable names must begin with a letter or an underscore.
Case sensitive
Variable names in Python are case sensitive, meaning uppercase and lowercase letters are treated differently.
Copy and paste
A good practice for long variable names is to copy and paste them to avoid typing errors.
x
A variable with the value 5.
temperature
A variable with the value 70.
pi
A variable with the value 3.14.1. Variables:User-defined names used to store data in a program.
Variable names
Names given to variables, which are not predefined and can be chosen by the user.
Reserved words
Predefined words in a programming language that have a specific meaning and cannot be used as variable names.
Best practice
Recommended approach or method that is considered the most effective or efficient.
Self-explanatory
Descriptive and clear enough to understand without additional explanation.
Readability of code
The ease with which code can be understood and interpreted by humans.
Debugging
The process of identifying and fixing errors or bugs in a program.
Troubleshooting
The process of identifying and resolving problems or issues in a system or program.
hininches
A variable name assigned the value 20.
h_in_in
Another variable name assigned the value 20.
height_inches
A variable name assigned the value 20.1. Python Basics:Fundamental concepts and principles of the Python programming language.
Structures
The different types of data structures in Python, such as lists, tuples, and dictionaries.
Assignment with expression
Assigning a value to a variable using an expression, such as "y = x*7".
Note
A comment or remark in the code, indicated by the "#" symbol.
type('Hello, World!')
A function that returns the type of the given object, in this case, the string 'Hello, World!'.
str
The data type for strings in Python.
Variables
Named containers that hold values in Python, such as X, y, and pi.
print(pi)
A statement that prints the value of the variable pi.
NameError
An error that occurs when a variable is not defined or cannot be found.
Operator
*:The multiplication operator in Python.
Constant
A fixed value that does not change during the execution of a program, such as 7 and 3.14.
Assignment statement
A statement that assigns a value to a variable, such as "pi = 3.14".
Print statement
A statement that prints the value of a variable or an expression.
Function
A block of reusable code that performs a specific task, such as print and type.
#so without creating a variable, we cannot use them in a function or program.
A comment indicating that variables need to be created before they can be used in a function or program.1. Variables:Symbols or letters used to represent unknown quantities in equations.
Equation
A mathematical statement that shows the equality between two expressions.
Updated
Changed or modified to reflect new information or calculations.
Computation
The process of performing mathematical calculations or operations.
X
A variable that represents an unknown quantity in the given equation.
Y
Another variable that represents a different unknown quantity in the equation.
*
The multiplication operator used to multiply two or more values.
=
The equality operator used to show that two expressions are equal.
10
The initial value assigned to the variable X.
25
The initial value assigned to the variable Y.
0.5
A constant value used in the computation of the equation.
125
The final value of the variable X after the computation is performed.1. Operator Precedence:The order in which operators are evaluated in an expression.
Parentheses
Symbols used to group expressions and override the default operator precedence.
Exponent
An operator used to raise a number to a power.
Division
An operator used to divide one number by another.
Multiplication
An operator used to multiply two numbers.
Remainder
An operator used to find the remainder of a division operation.
Addition
An operator used to add two numbers.
Subtraction
An operator used to subtract one number from another.
Left to right
The direction in which operators are evaluated when they have the same precedence.1. Operator Precedence:The order in which operators are evaluated in an expression. In Python, the operator precedence follows the PEMDAS rule (Parentheses, Exponents, Multiplication and Division, Addition and Subtraction).
PEMDAS
An acronym that stands for Parentheses, Exponents, Multiplication and Division, Addition and Subtraction. It represents the order of operations in mathematics and is used to determine the precedence of operators in Python.
+ (Addition)
An arithmetic operator in Python used to add two values together.
* (Multiplication)
An arithmetic operator in Python used to multiply two values.
- (Subtraction)
An arithmetic operator in Python used to subtract one value from another.
/ (Division)
An arithmetic operator in Python used to divide one value by another.
** (Exponentiation)
An arithmetic operator in Python used to raise a value to the power of another value.
print()
A built-in function in Python used to display output on the console.
z
A variable that holds a value, which is printed using the print() function.
Output
The result or value that is displayed as a result of executing a program or code. In this case, the output is 25.92.1. Operator Precedence:The order in which operators are evaluated in an expression.
Parentheses
Symbols used to group expressions and override the default operator precedence.
Readability
The quality of code that makes it easy to understand and follow.
Debugging
The process of identifying and fixing errors or bugs in code.
Intended Results
The desired outcome or output of a program or operation.
Computed Wrongly
When an operation or calculation is performed incorrectly, resulting in incorrect output.1. Identifier Types:Different types of variables, constants, or literals used in programming.