Progaymming Flashcards

1
Q

Arrays

A

Arrays store multiple values in one single variable.
You can access the values by referring to an index number.
guns = [“AKM”, “AR15”, “SKS”]
print(guns[2])

SKS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 2 kinds of modules?

A

Library functions - These are predefined/built in functions like calculations,
ex: import math

User-defined - These are functions designed by the user for when you don't have a predefined module.
ex: MyModule.PY
def greeting(name):
  print("Hello, " + name)

import mymodule

mymodule.greeting(“Jonathan”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a module?

A

Modules are python files that contain statements and definitions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a function?

A

a block of code which only runs when it is called.

You can pass parameters into a function and a function can return data as a result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is OOP?

A

Object Oriented Programming.
(OOP) is a programming model that relies on the concept of classes, objects and methods.
Classes share attributes
Methods are functions defined within the class
classes also are used as blueprints for individual objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is inheritance? (ICMP)

A

Inheritance defines a class that inherits all the methods and properties from another class.

Parent class is the class being inherited from.
Child class is the class that inherits from another class.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly