Docsity

Python Programming Fundamentals: A Comprehensive Study Guide, Exams of Computer Networks

Toggle sidebar
bg1
Python Chapter 1 2025/2026 STUDY
GUIDE
Hardware
All the physical devices or components that a computer is made of is called ___________
① Store Data
② Move Data
③ Manipulate Data
④ Adjust control flow based on data
Basic four operations of computers
CPU, main memory, secondary storage devices, input and output devices.
Examples of Hardware. The five major components of a computer.
Central Processing Unit (CPU)
The part of the computer that actually runs programs. The "brain."
Main Memory (RAM)
Where the computer temporarily stores a program and the data it is using while the program is running.
It is a volatile type of memory that is cleared once the device shuts down.
Secondary Storage Devices
A type of memory that can hold data for long periods of time, even when there is no power to the
computer.
Disk drive, floppy disk, USB drives, memory sticks/flash dries, CDs, DVDs
Examples of Secondary Storage Devices
Input Device
Any device that the computer uses to collect data from people.
Example Keyboard, mouse
Output Device
pf3
pf4
pf5

Partial preview of the text

Download Python Programming Fundamentals: A Comprehensive Study Guide and more Exams Computer Networks in PDF only on Docsity!

Python Chapter 1 2025/2026 STUDY

GUIDE

Hardware All the physical devices or components that a computer is made of is called ___________ ① Store Data ② Move Data ③ Manipulate Data ④ Adjust control flow based on data Basic four operations of computers CPU, main memory, secondary storage devices, input and output devices. Examples of Hardware. The five major components of a computer. Central Processing Unit (CPU) The part of the computer that actually runs programs. The "brain." Main Memory (RAM) Where the computer temporarily stores a program and the data it is using while the program is running. It is a volatile type of memory that is cleared once the device shuts down. Secondary Storage Devices A type of memory that can hold data for long periods of time, even when there is no power to the computer. Disk drive, floppy disk, USB drives, memory sticks/flash dries, CDs, DVDs Examples of Secondary Storage Devices Input Device Any device that the computer uses to collect data from people. Example Keyboard, mouse Output Device

Any device that the computer uses to produce data for people. Example: Video displays, screens, printer Operating Systems the most fundamental set of programs on a computer which controls the internal operations of the computer's hardware, manages all of the connected devices, allows data to be saved to and retrieved from storage devices, and allows other programs to run on the computer. Example: Windows, Mac OS, Linux 0s, 1s All data that is stored in a computer is converted to a sequences of _____s and _____s Machine language A computer's CPU can only understand instructions that are written in __________________________. Because people find it difficult to write entire programs in ___________________________, other programming languages have been invented. Reading a piece of data from main memory, addition, subtraction, multiplication, division, moving data for one memory location to another, determining equality between values. A CPU is designed to perform operations such as: The program is copied from the disk to the main memory then the CPU executes the copy of the program. Situation: You double click on a program's icon on your desktop to "open" it. Where does the program go? Where is it moved to?

**1. Fetch- program instructions are read

  1. Decode- program instructions are decoded to determine which operation to perform
  2. Execute- the operation is performed** Explain the fetch-decode-execute cycle by steps: High-Level Language Computer languages that allow you to create powerful and complex programs without knowing how the CPU works, and without writing large numbers of low-level instructions Syntax A set of rules that must be strictly followed when writing a programs Operators Characters that perform various operations on data Compiler A program that translates a high-level language program into a separate machine language program. Interpreter A program that both translates and executes the instructions in a high-level language program

a comment that appears at the end of a line of code Assignment statement a statement which creates a variable and makes it reference a piece of data Assignment opperator The equals sign (=) is known as the ____________________________. I am staying in room number 503 room = 503 print('I am staying in room number', room) What will be displayed? int and float What are the 2 numeric data types? int whole numbers without decimals, integers float rational numbers, numbers with decimal places str Use the command ________ to save data as a string


Exponent symbol int, float, float Operations performed with 2 ints will result in a(n) __________. Operations performed with 2 floats will result in a(n) _____________. Operations performed with an int and a float will yield a(n) ________________. Mixed-type expression an expression that uses operands of different data types (ie an int and a float) ** known as the "line continuation character" Function a group of statements that exist within a program for the purpose of performing a specific task Simplifies code, code reuse, better testing, faster development, easier facilitation of teamwork Why use functions? defined A function must be ______________ before it can be used. Function header the first line of a function that begins with the key word def def function_name(): Function header format is:

Block statements following the function header that define the function and are indented from left margin called A function does not execute until it is ______________. function_name() Format for calling functions is: "a machine that stores and manipulates information under the control of a changeable program." ●Two key elements: ●Computers are devices for manipulating information. ●Computers operate under the control of a changeable program A modern computer can be defined as: ●A detailed, step-by-step set of instructions telling a computer what to do. ●If we change the program, the computer performs a different set of actions or a different task. ●The machine stays the same, but the program changes! What is a computer program? Programming The process of creating software is called_______ Software, hardware. The ____ware rules the ______ware. The study of what can be computed and how it can be computed. What is computer science? One way to show a particular problem can be solved is to actually design a solution. ●This is done by developing an algorithm, a step-by-step process for achieving the desired result. ●One problem - it can only answer in the positive. You can't prove a negative! How can you show that a problem can be solved? Analysis is the process of examining algorithms and problems mathematically. ●Some seemingly simple problems are not solvable by any algorithm. These problems are said to be unsolvable. ●Problems can be intractable if they would take too long or take too much memory to be of practical value. What is analysis? Experimentation ●Some problems are too complex for analysis. ●Implement a system and then study its behavior. What do you do if a problem is too difficult to solve with mathematically analyzing your algorithms? main memory (RAM)

We'll use _________ when we save our work to indicate it's a Python program. Variable A ___________ is used to assign a name to a value so that we can refer to it later. ●The quoted information is displayed, and the number typed in response is stored in x. Loop for i in range(10): ●For is a ________ construct ●A ______ tells Python to repeat the same thing over and over. ●In this example, the following code will be repeated 10 times. Body The _______ of the loop is what gets repeated each time through the loop. ●The _______of the loop is identified through indentation. ●The effect of the loop is the same as repeating it x times!