FOP: Module 2

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:35 AM on 10/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

32 Terms

1
New cards

Python

  • an interpreted, object-oriented, high-level programming language

  • created by Guido van Rossum and released in 1991


2
New cards

Why Use Python?

  1. Easy to learn and use

  2. Versatile

  3. Large community and ecosystem

  4. Cross-platform support

  5. High-level language

  6. Interpreted language


3
New cards
  1. Easy to learn and use


has a simple and easy-to-read syntax


4
New cards
  1. Versatile


python can be used for a wide range of applications including web dev, data analysis, ai, scientific computing, game dev, etc.

5
New cards
  1. Large community and ecosystem


python has a large and active community of developers who contribute to the development of libraries and tools

6
New cards
  1. Cross-platform support


python can use a variety of platforms (windows, macOS, linux, etc.)

7
New cards
  1. High-level language


python is designed to be more human-readable, making it easier to write and maintain code

8
New cards
  1. Interpreted language


no need to compile code before it can be executed, making it easier to write and test code

9
New cards

Why Use Python?

  • Web Apps

  • For Data Science and Data Visualization

  • Machine Learning

  • Script for Vulnerability Testing


10
New cards

Variables

  • containers used to store the value or results

  • a named location reserved to store values in the memory

  • equal sign (=) is used to assign values to variables

subject (the variable) = “fop” (the value)

11
New cards

Data Types

  • String

  • Integer

  • Float

  • Boolean


12
New cards

name = “Micaila Almin”

str or string

13
New cards

age = 18

int or integer

14
New cards

grade = (99.9)

float

15
New cards

continue = True

boolean

16
New cards

Naming Variables

  1. The name of the variable must be composed of upper-case or lower-case letters, digits, and the character _ (underscore)

  2. The name of the variable must begin with a letter

  3. The underscore character is a letter

  4. Upper- and lower-case letters are treated as different

  5. The name of the variable must not be any of Python's reserved words/keywords


17
New cards

Keywords

  • reserved keywords because you musn’t use them as names

  • predefined


18
New cards

Indentation

used to indicate a code block

if a == 1
print(“Yes”)

19
New cards

print() function

  • built-in function

  • prints/outputs a specified message to the screen/console window


<ul><li><p>built-in function</p></li><li><p>prints/outputs a specified message to the screen/console window</p></li></ul><p></p>
20
New cards

Two keyword arguments of print() function

  1. end

  2. sep (separator)


<ol><li><p>end </p></li><li><p>sep (separator)</p></li></ol><p></p>
21
New cards

Common Escape Sequence


<p></p>
22
New cards

input() function

  • accepts user input


name = input(“Enter Full Name:”)
print(“Name:” + name)

23
New cards

Casting

  • converting one data type into another


<ul><li><p>converting one data type into another</p></li></ul><p></p>
24
New cards

Arithmetic Operators

knowt flashcard image
25
New cards

String

series or characters interpreted as text

26
New cards

Concatenation

knowt flashcard image
27
New cards

Multiple Line of Text

  • you can use 3 double quote or 3 single quote to display multiple text


<ul><li><p>you can use 3 double quote or 3 single quote to display multiple text</p></li></ul><p></p>
28
New cards

Strings Placeholders

containers for strings and numbers:

  • {} format

  • %

  • F or f


29
New cards

String Formatting Functions

knowt flashcard image
30
New cards

Comments

#This is a single line comment


31
New cards

Multi lined comment

#This is a comment
#written in
#more than just one line

“““ This is a comment written in more than just one line “““

32
New cards

Inline comment

print(“Hello World”) #This is an inline comment