IntroCom (Reviewer) PDF
Document Details
Tags
Summary
This document introduces fundamental computer science concepts, covering computer generations, hardware components, software types, and a brief overview of the programming language Python. It also describes input/output, memory, and different types of processors.
Full Transcript
Computer An electronic device that manipulates information, or data. It can store, retrieve, and process data. Generations of Computers Vacuum Tube Based (1940-1950) (1st Gen) have the functionality of controlling the flow of electronics in a vacuu...
Computer An electronic device that manipulates information, or data. It can store, retrieve, and process data. Generations of Computers Vacuum Tube Based (1940-1950) (1st Gen) have the functionality of controlling the flow of electronics in a vacuum. Generally, it is used in switches, amplifiers, radios, televisions, etc. Transistor Based (1950-1960) (2nd Gen) helps in controlling the flow of electricity in devices, it works as an amplifier or a switch. Integrated Circuit Based (1960-1970) (3rd Gen) are silicon chips that contain their circuit elements like transistors, resistors, etc. Microprocessor Based (1970-Present) (4th Gen) One microprocessor can contain all the circuits required to perform arithmetic, logic, and control functions on one chip. AI Based (Present-Future) (5th Gen) deals with creating intelligent machines and behaviors. Five types of Computers Supercomputers – most powerful, usually used in big orgs. Mainframes – < S.C, multi-tasking, high data storage. Mid-range Computers – used in medium sized companies. Microcomputers – modern computers, desktop, notebooks or laptops. Handheld Computers – smallest computer. Hardware Physical elements Input, output, etc. Tangible Can be replaced when damaged Software Can’t be touched Intangible Written instructions using prog language Can be reinstalled when damaged Should be installed in the system to function Input – data or info entered the computer. Output – information displayed. Memory – devices used to store data. Computer Software System Software – OS, device drivers, utilities. Application Software – used by the end-user. Data placed in the computer. Python – a popular programming language (1991) by Guido van Rossum. Works on different platforms/OS. Python is readable and like English language. Fewer codes than Java. Comment (#) – to explain the code, to make code more readable, Python ignores them. Variables – containers for storing data values. No need for command to declare. No need to be declare. Must start with letter or underscore. Cannot start with a number. Only allowed letters, numbers and _. Case-sensitive Should not be any of the reserved words. ▪ And ▪ As ▪ Break ▪ Del ▪ Alif ▪ Else ▪ For Etc. ▪ In ▪ Not ▪ Ora ▪ True/false Camel Case – myVarName Pascal Case – MyVarName Snake Case – my_var_name Type Casting – specify a data type like (int, str, float) Single (‘’) and Double (“”) quotes are the same. Print()- so display output Can use , or + for multiple variables. Type()- to verify the type of object (int, str, float). Integer (int) – a whole number. Float- a number with decimals. String (str)- words or letters. User Input – input() Arithmetic Operators – numeric values to perform common mathematical operations. + Addition - Subtraction * Multiplication / Division % Modulus - use to get the remainder ** Exponentiation - (2 ** 5) same as 25 // Floor division Assignment Operations – used to assign values to variables = Assignment += Addition Assignment -= Subtraction Assignment *= Multiplication Assignment /= Division Assignment %= Modulus Assignment **= Exponentiation Assignment //= Floor Division Assignment Comparison Operators – used to compare two values == Equal != Not equal > Greater than < Less than >= Greater than or equal to < Less than or equal to Logical Operators – used to combine conditional statements. and if both statements are true, returns TRUE or if one of the statements is true, returns TRUE not reverses the result (Ex: Not(T) = F) Identity Operators – used to compare the objects if they are THE SAME OBJECT, with the same memory location. is returns TRUE if both variables are the same is not returns TRUE if both variables are NOT the same Membership Operators – used to test if a sequence is presented in an object. in returns TRUE if a sequence with the specified value is present in the object. not in returns TRUE if a sequence with the specified value is NOT present in the object. If – written by using (if) keyword. Shorthand if – if you have only one statement to execute, use this. elif - “if the previous conditions were not met, then try this condition”. Shorthand if…else – if you have only one statement to execute you can you can put it all on the same line. else - it catches anything which isn’t caught by the preceding conditions. Nested if - having if statements inside an if statements.