Python Programming Glossary - Hsanokklis/2023-2024-Tech-journal GitHub Wiki

IDE - Integrated Development Environment

Complied Programming Languages

Interpreted Programming Languages

Computing Agent

Data Structure

Delimiter

Inheritance

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

image

image

image

Math example

image

  • you cannot do math with a variable defined with a string, you will get an error message.

image

Variable Reassignment

  • The varible that is assigned later will overide the one before
  • reassigning the value of result

image

Lists

  • Can have mixed variables
  • defined by brackets []

image

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

print

  • prints a string, such as print("Hello World")

image

image

comment #

  • text that is not executed when the program is run

image

Block comments """ or '''

  • Comments that are on multiple lines in the terminal

image

image

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