Module 1 Flashcards

(92 cards)

1
Q

What is a variable in programming?

A

A variable is a container used to store data values.

Example in Python:

python
Copy
Edit
name = “David”
age = 25

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

What are the basic data types in Python?

A

int: Integer (10)

float: Decimal number (3.14)

str: String (“Hello”)

bool: Boolean (True or False)
Example:

python
Copy
Edit
price = 19.99 # float
is_paid = False # bool
username = “Alex” # str

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

What is a function and why is it used?

A

A function is a block of reusable code that performs a specific task.

Example:

python
Copy
Edit
def greet(name):
print(f”Hello, {name}!”)

greet(“David”)

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

What are the types of functions in Python?

A

Built-in functions: print(), len(), range()

User-defined functions: You create them with def
Example:

python
Copy
Edit
def add(x, y):
return x + y

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

What is a conditional statement?

A

It is used to perform different actions based on different conditions using if, elif, and else.
Example:

python
Copy
Edit
age = 20
if age >= 18:
print(“Adult”)
else:
print(“Minor”)

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

What is a for loop?

A

A for loop repeats code a certain number of times.
Example:

python
Copy
Edit
for i in range(5):
print(i)
Output: 0 1 2 3 4

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

What is a while loop?

A

A while loop repeats code as long as a condition is true.
Example:

python
Copy
Edit
count = 0
while count < 3:
print(“Hi”)
count += 1

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

What is the difference between mutable and immutable types?

A

Mutable: Can be changed (e.g., lists)

Immutable: Cannot be changed (e.g., strings, tuples)
Example:

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

How do you convert between data types?

A

A4:
Use built-in functions like int(), float(), str()
Example:

python
Copy
Edit
price = “100”
converted = int(price)

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

What is the difference between a parameter and an argument?

A

arameter is a variable in a function definition.

Argument is the actual value passed to the function.

Example:

python
Copy
Edit
def add(x, y): # x and y are parameters
return x + y

add(3, 5) # 3 and 5 are arguments

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

What is a return statement and how is it used?

A

The return statement ends a function and optionally sends back a value.

Example:

python
Copy
Edit
def square(n):
return n * n

result = square(4) # returns 16

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

What is a default parameter value?

A

t allows a function to use a default value if no argument is passed.

Example:

python
Copy
Edit
def greet(name=”Guest”):
return f”Welcome, {name}!”

print(greet()) # Output: Welcome, Guest!
print(greet(“Alice”)) # Output: Welcome, Alice!

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

What are keyword arguments?

A

hey allow you to call a function using parameter names explicitly.

Keyword arguments (or named arguments) are values that, when passed into a function, are identifiable by specific parameter names. A keyword argument is preceded by a parameter and the assignment operator, = .

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

What is a variable-length argument (*args, **kwargs)?

A

A6:

*args allows multiple positional arguments.

**kwargs allows multiple keyword arguments.

Example:

python
Copy
Edit
def print_args(*args):
for arg in args:
print(arg)

def print_kwargs(**kwargs):
for key, value in kwargs.items():
print(f”{key}: {value}”)

print_args(1, 2, 3)
print_kwargs(name=”David”, age=25)

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

What is a lambda function?

A

A lambda is a small anonymous function using the lambda keyword. Best for short, one-liner functions.

Syntax:

python
Copy
Edit
lambda arguments: expression
Example:

python
Copy
Edit
square = lambda x: x * x
print(square(5)) # Output: 25

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

Can a function return multiple values?

A

Yes, it can return multiple values as a tuple.

Example:

python
Copy
Edit
def get_min_max(numbers):
return min(numbers), max(numbers)

low, high = get_min_max([1, 3, 9])
print(low, high) # Output: 1 9

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

What is recursion?

A

technique where a function calls itself to solve smaller instances of a problem.

Example:

python
Copy
Edit
def factorial(n):
if n == 1:
return 1
return n * factorial(n - 1)

print(factorial(5)) # Output: 120

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

What are some real-world uses of functions?
A10:

A

User input processing

Data transformation

Web requests handling

Repeated tasks like calculations or string formatting

Example in Web App:

python
Copy
Edit
def calculate_total(cart_items):
return sum(cart_items)

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

What is web Development?

A

Web development refers to the overall process of creating websites or web applications, including the project’s design, layout, coding, content creation, and functionality. It involves using a combination of programming languages, tools, and frameworks to bring a website or web application to life.

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

Define and expalin the two sectors of web development?

A

Front-End (Client-Side): What users interact with directly in the browser. This includes HTML, CSS, and JavaScript.

Back-End (Server-Side): Handles server logic, database interactions, and application functionality. This is typically managed using server-side languages like Python, or PHP.

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

What is a frontend(Client side)

A

Front-end development involves the “client-facing” side of web development. That is to say usually, front-end web development refers to the portion of the site, app, or digital product that users will see and interact with. A Front-End Developer, therefore, is responsible for the way a digital product looks and “feels,” which is why they are often also referred to as Web Designers.

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

What is a full stack Developer?

A

A Full-Stack Developer is someone familiar with both front- and back-end development. Full Stack Developers usually understand a wide variety of programming languages and because of their versatility, they might be given more of a leadership role on projects than developers who specialize. They are generalists, adept at wearing both hats, and familiar with every layer of development. Obviously, employers want to hire Full-Stack Developers – according to an Indeed study, they are the fourth-most in-demand job in tech.

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

Define and state the stages involve in web development.

A

Planning: Understanding the project requirements and goals.
Design: Creating wireframes and mockups to visualize the layout and user experience.
Development: Writing code to build the website or application.
Testing: Ensuring the website works correctly across different browsers and devices.
Deployment: Making the website live on the internet.
Maintenance: Updating and improving the website over time.

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

What are backend Developers

A

if Front-End Developers are responsible for how a digital product looks, Back-End Developers are focused on how it works. A Back-End Developer creates the basic framework of a website before maintaining it and ensuring it performs the way it should, including database interactions, user authentication, server, network and hosting configuration, and business logic. Working behind the scenes – or server-side – Back End Developers are concerned with the systems and structures that allow computer applications to perform as desired.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is HTML?
HTML is the backbone of any web page. It provides both semantic structure and defines the elements of a website, such as headings, paragraphs, images, and links. Web developers use HTML to give content a proper layout before customizing it. 
26
What is a Markup Language?
A Markup Language is a way that computers speak to each other to control how text is processed and presented. To do this HTML uses two things: tags and attributes.
27
Who Create the python programming language and when?
Python is a high-level, object-oriented programming language used in coding, created by Guido van Rossum in 1991.[1] Python puts readability at a high standard and this makes it great for both programmers and non-programmers to learn
28
What are tags and attribute?
Tags and attributes are the basis of HTML.
29
What is OOP
OOP is a programming paradigm that organizes code around objects, which are instances of classes. Concepts such as encapsulation, inheritance, and polymorphism facilitate code reusability, modularity, and maintenance
30
What are HTML tags
ags are used to mark up the start of an HTML element and they are usually enclosed in angle brackets. An example of a tag is:

. Most tags must be opened

and closed

in order to function.
31
What is Assembly Language?
Assembly language is easier to use than machine language. An assembler is useful for detecting programming errors. Programmers do not have the absolute address of data items. Assembly language encourage modular programming
32
What are HTML Attributes?
Attributes contain additional pieces of information. Attributes take the form of an opening tag and additional info is placed inside.
33
Define and Expalin HTML document structure
Every HTML document begins with which tells the browser that the document is an HTML5 document. The document is wrapped in the tag. Contains two main sections: Head (): Contains meta-information about the document, such as the title, character set, and links to stylesheets. Body (): Contains the content that is displayed on the webpage, such as text, images, links, and forms.
34
What is a positional arguement?
Positional arguments are values that are passed into a function based on the order in which the parameters were listed during the function definition. Here, the order is especially important as values passed into these functions are assigned to corresponding parameters based on their position.
35
What are default arguement?
Default arguments are keyword arguments whose values are assigned at the time of function definition.
36
What are optional arguement?
Optional arguments are default arguments that, based on the values assigned to them (e.g., None or 0), can be disregarded.
37
What is a syntax error?
In Python, a syntax error is basically an error that goes against a rule in Python
38
What are kwargs and args?
args: for non-keyworded/positional arguments **kwargs: for keyworded arguments. These labels, *args and **kwargs, represent the iterables that would be accessed during a function call. A single asterisk signifies elements of a tuple, whereas double asterisks signify elements of a dictionary.
39
What is control flow?
Control flow refers to the order in which statements and instructions are executed in a program. It determines how the program progresses from one instruction to the other
40
What are loops?
Loops are used to repeat a task automatically until a condition is met. Instead of writing the same line many times, you can loop it.
41
What is a list?
A list is a collection of items stored in a single variable. Lists can hold multiple data types (strings, numbers, booleans, etc.).
42
What is the syntax for a list?
fruits = ["David", "Monica", "Spiro"]
43
How do we change a list item in a list
fruits[1] = "Michael" This syntax does change the item monica to Michael
44
Name and define the function of all list operation
Operation Code Example Description Length len(fruits) Number of items in the list Append item fruits.append("grape") Adds to the end Insert item fruits.insert(1, "kiwi") Inserts at specific position Remove item fruits.remove("banana") Removes specific item Pop item fruits.pop() Removes last item Index of item fruits.index("orange") Finds index of item Sorting fruits.sort() Sorts list (alphabetical/numeric) Reversing fruits.reverse() Reverses the list
45
What is the syntax for looping through a list
for fruits in fruits print(fruit)
46
What is a tuple?
A tuble is like a list, but you can't change it item after it's created. it's immutable
47
When do you use a tuple?
When you want a fixed collection of values (e.g., coordinates, months of the year). For safer, read-only data that shouldn't change.
48
What is a dictionary?
A dictionary store data in key value pairs. it's good for labelled data.
49
Name three properties of a dictionary
Unordered (Python 3.7+ maintains insertion order) Mutable (you can change, add, or remove items) Keys must be unique
50
What is the strip function in python?
The strip() method removes any leading, and trailing whitespaces. Leading means at the beginning of the string, trailing means at the end.
51
Define the .title string in python
The title() method returns a string where the first character in every word is upper case. Like a header, or a title. If the word contains a number or a symbol, the first letter after that will be converted to upper case.
52
What is a method?
In Python, a method is a function that belongs to an object or a class. It is defined within a class and operates on the data (attributes) of that class's instances (objects).
53
What is the difference between a Class and an ID in html
A class name can be used by multiple HTML elements, while an id name must only be used by one HTML element within the page:
54
Define the Web Content Accesibility Guideine?
The Web Content Accessibility Guidelines (WCAG) are a set of guidelines for making web content more accessible to people with disabilities. The four principles of WCAG are POUR which stands for Perceivable, Operable, Understandable, and Robust.
55
What is a Screen Reading Technology?
Software programs that read the content of a computer screen out loud. They are used by people who are blind or visually impaired to access the web.
56
What are Large Text or Braille Keyboards?
Are Used by people with visual impairments to access the web
57
What are Screen magnifiers
Software programs that enlarge the content of a computer screen. They are used by people with low vision to access the web
58
Alternative pointing devices
Used by people with mobility impairments to access the web. This includes devices such as joysticks, trackballs, and touchpads.
59
Voice recognition
Used by people with mobility impairments to access the web. It allows users to control a computer using their voice.
60
What is WAI-ARIA?
It stands for Web Accessibility Initiative - Accessible Rich Internet Applications. It is a set of attributes that can be added to HTML elements to improve accessibility. It provides additional information to assistive technologies about the purpose and structure of the content.
61
What are primitives in CS?
In computer science, primitives (or primitive data types) are the fundamental, built-in data types within a programming language, representing the simplest values that cannot be broken down into smaller components
62
What is a static Sematic Error?
A static semantic error is an error in a program's meaning or logic that a compiler can detect before the program runs.
63
What is a program?
A program is a sequence of definitions and instructions
64
What is CSS Specificity?
CSS specificity is a fundamental concept that determines which styles are applied to an element when multiple styles could apply
65
What is Indexing?
66
What are the four type of Specificity values?
a: inline styles b: number of ID selectors c: number of class selectors, attribute selctors and pesudo classes d: number of type selectors, pseudo element and universal selectors.
67
What is Slicing?
Slicing in Python is a technique used to extract a portion or "slice" of a sequence, such as a string, list, or tuple. It allows for accessing a range of elements within the sequence, rather than just a single element, by specifying a start and end index, and optionally a step.
68
What is alignment?
Alignment is a process of arranging texts and images in a way that creates a visual connection between elements
69
What is an active white space
An active white space is the space that is created to guide the user's eye and draw attention to certain element on the page
70
What is a Macrospace?
A macrospace is the space created around big elements like images, buttons, and textblocks.
71
What is a Passive Whitespace?
This is the space that is leftover after all element have been placed.
72
What is micro Whitespace?
This is the space between individual characters in a line of text
73
What is the law of proximity?
The law of proximity state that elements that are close are perceived as related while elements that are far apart are pereived as urelated
74
What are responsive images??
Responsive images are images that scale to fit the size of the device they are being viewed on. it ensure images are good on all devices.
75
What is progressive Ehancement in Web Design?
Progressive enhancement is a design approach that ensures all users, regardless of browser or device, can access the essential content and functionality of an application.
76
What are the core principles of progressive enhancement?
All core content and basic functionality should be accesible on all browsers All functionality should be provided through external javascript files. All advanced layout should be provide through external stylesheet. A user's browser preferences should be respected
77
What is a user Research?
A user research is a systematic study of the people that use your behavior. it runs down to three main goals which are: Measuring customer behavior, painpoint and needs.
78
What is a Net Promotion Score (NPS)?
A net promotion is used to determing how likely users or customers are to recommend your product or application to a friend. It varies from a range of 0-10. A lower promotion score indicates low promotion from a particular user and vice-versa.
79
What is an Exit Interview?
An exit interview is a survey sent to users who cancel a subscription or delete an account. Data from this survey can be used as an insight to address problems like customer churn etc.
80
What is user testing?
User testing refers to the data collected from users when they are interfacing with your application. It involves the A/B testing, which is creating a new feature for a specific subset of your users and later gathering information on whether the feature is beneficial or not.
80
What is User requirement?
User requirement refers to the ruberics, procedures, functon and non functional requirement an application should posses for it users.
81
What are Breadcrumbs in Web Design?
Breadcrumbs are a navigation aid that help to direct users of where they are in the website hierarchy.
82
What is infinite scroll?
Infinite scroll is a design pattern that loads more content as users scroll down the page.
83
What is pagination?
Pagination is a design pattern that breaks up content into pages
84
What is a modal?
A modal is the type of pop up that websites create on top their content.
85
What is a Design Brief?
A design brief is a document that outline te goal, objective and requirements of a project.
86
What is a progress indication?
A progress indication is a way to show users how far they are in a process. It's normally used in forms, registration, installations etc.
87
Describe the element of a Design Brief
1. The company's details, mission, selling points, product, and services. 2. Another major element is the aim, goals and objective of the projects 3. Another key element would be the target audience. The design brief should include information about the target demographics, interests, and needs of the audience. 4. Another key element would be the project scope. This should include the deliverables, timeline, and budget. The deliverables should include a list of all the items that will be produced as part of the project, such as mockups, and final designs.
88
What is a Lazy Registration?
A lazy registration is a UI design pattern that allows customers to interact with or access your website without having to register. Lazy registration is a useful design pattern that will enable users to see the value of your application before they are willing to provide their information.
89
What is Prototyping?
Prototyping is the process of creating an interactive model or vesion of a product or user interface.
90
90