Python Programming Glossary - Hsanokklis/2023-2024-Tech-journal GitHub Wiki
IDE - Integrated Development Environment
Complied Programming Languages
Interpreted Programming Languages
General Python Syntax
Variables and variable naming
- Be descriptive with your variable naming
- No spaces
- never start with a number (but you can still have a number in the variable name such as num1)
- Do not use special characters (except for underscore _)
- Cannot have mixed data structures
Math example
- you cannot do math with a variable defined with a string, you will get an error message.
Variable Reassignment
- The varible that is assigned later will overide the one before
- reassigning the value of result
Lists
- Can have mixed variables
- defined by brackets []
Data Types
Defines the category of data held in a data structure
-
String ---> Text ("Hello World"), ("5")
-
Integer ---> Numbers
-
Float ---> Numbers with decimals
-
Boolean ---> True or False
Math commands
Division with //
- Makes the output rounded
*Division with /
- divides normally
Modulus
- prints the remainder of a division problem
Commands
- prints a string, such as print("Hello World")
comment #
- text that is not executed when the program is run
Block comments """ or '''
- Comments that are on multiple lines in the terminal
str()
- converts integer data type to string
int()
- converts a string data type to an integer
len()
- returns the total number of characters in a variable
float()
- converts integers(includes strings) into a float
input()
- allows for user input