Computer Science Basics Quiz
116 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which statement accurately describes high-level programming languages?

  • They were primarily developed in the 1980s and 1990s.
  • They are less abstract and closer to machine language.
  • They resemble human language more than assembly language. (correct)
  • They require explicit memory management in every instance.
  • What is a correct characteristic of identifiers in Python?

  • They must include at least one symbol.
  • They can start with digits.
  • They are not case sensitive.
  • They cannot contain spaces. (correct)
  • What is true about the identity of an object in Python?

  • It can be changed during the execution of the program.
  • It is specific to the type of data stored in the object.
  • It can be accessed using the built-in function id(). (correct)
  • It is the same as the value of the object.
  • Which of the following data types is immutable?

    <p>Strings</p> Signup and view all the answers

    What is an example of incremental development?

    <p>Testing after every few lines of code written.</p> Signup and view all the answers

    What is the primary function of a compiler in programming?

    <p>To translate high-level programming languages into low-level machine instructions</p> Signup and view all the answers

    Which statement correctly describes a container in programming?

    <p>It organizes similar or related values together and contains references to other objects</p> Signup and view all the answers

    What would be the best choice for a data type if order is important and the data should remain unchanged?

    <p>Tuple</p> Signup and view all the answers

    What is the primary purpose of computational thinking?

    <p>To solve problems logically by breaking them into smaller parts and finding patterns</p> Signup and view all the answers

    What does decrementing refer to in programming?

    <p>Decreasing a value by a fixed amount repeatedly</p> Signup and view all the answers

    Which processor speed corresponds to a more expensive processor typically found in smart devices?

    <p>1 GHz</p> Signup and view all the answers

    What can be defined as a unique number used to represent every possible character in Unicode?

    <p>Code point</p> Signup and view all the answers

    What does debugging involve?

    <p>Finding and fixing bugs in existing code</p> Signup and view all the answers

    Which statement accurately describes the function of a core in a processor?

    <p>It executes instructions and performs computations</p> Signup and view all the answers

    Which data type can be appended to but not mathematically added?

    <p>String</p> Signup and view all the answers

    What is a keyword in Python?

    <p>A reserved word with a special meaning in the language</p> Signup and view all the answers

    Which statement about lists is true?

    <p>Each element in a list is referred to by its index</p> Signup and view all the answers

    What does a logic error refer to in programming?

    <p>A bug in the code that causes incorrect behavior</p> Signup and view all the answers

    What is the primary function of memory in a computer?

    <p>To temporarily hold data and instructions for quick access</p> Signup and view all the answers

    Which of the following is an example of a literal in Python?

    <p>'Hello, World!'</p> Signup and view all the answers

    What is the significance of leading zeros in a number?

    <p>They are necessary for formatting purposes in programming</p> Signup and view all the answers

    What does the term 'megabyte' refer to?

    <p>A unit equal to 1,000,000 bytes</p> Signup and view all the answers

    How are machine instructions represented in a computer?

    <p>As sequences of 0s and 1s</p> Signup and view all the answers

    What is the primary purpose of a programming language compared to a scripting language?

    <p>To create larger and more complex software applications</p> Signup and view all the answers

    What does Pseudocode provide in the context of programming?

    <p>A detailed description of how a program should function that is easy for humans to understand</p> Signup and view all the answers

    Which feature of Python contributes to its overhead costs?

    <p>The fact that it is an interpreted language</p> Signup and view all the answers

    In RAM, what does 'random access' refer to?

    <p>Accessing any memory location without the need for sequential searching</p> Signup and view all the answers

    What is the correct definition of refactoring in programming?

    <p>Revising code for better performance and efficiency</p> Signup and view all the answers

    How do replacement fields function in an f-string in Python?

    <p>They allow any data type to replace an expression when printed</p> Signup and view all the answers

    What represents a runtime error in programming?

    <p>An error caused by attempting a division by zero operation</p> Signup and view all the answers

    What is the significance of Python Enhancement Proposal 8 (PEP 8)?

    <p>It sets the standards for writing Python code efficiently</p> Signup and view all the answers

    Which statement about a repeating decimal is correct?

    <p>It continues infinitely with a specific digit or sequence</p> Signup and view all the answers

    What best describes 'respectively' in a mathematical context?

    <p>It aligns elements in the same order mentioned for clarity</p> Signup and view all the answers

    What is the purpose of using a seed in the random module?

    <p>To generate repeatable pseudo-random sequences.</p> Signup and view all the answers

    Which of the following accurately describes a script in programming?

    <p>A saveable file containing interpreter-executable instructions.</p> Signup and view all the answers

    How are numbers represented in scientific notation?

    <p>With an 'e' representing powers of 10.</p> Signup and view all the answers

    What characterizes a set in programming?

    <p>A mutable unordered collection of unique elements.</p> Signup and view all the answers

    What is a string literal?

    <p>A fixed sequence of characters enclosed in quotation marks.</p> Signup and view all the answers

    Which of the following best describes sequence types?

    <p>They hold items in a specific order and can be accessed using an index.</p> Signup and view all the answers

    What is the primary function of a software program?

    <p>To execute tasks and perform operations on a computer.</p> Signup and view all the answers

    What does the empty string represent?

    <p>A sequence with no characters.</p> Signup and view all the answers

    What type of programming task are scripting languages primarily designed for?

    <p>Automating smaller tasks without the need for compilation.</p> Signup and view all the answers

    What happens when an OverflowError occurs in a programming context?

    <p>A floating-point value exceeds the allocated memory range.</p> Signup and view all the answers

    What is an executable program?

    <p>A sequence of machine instructions that can be run.</p> Signup and view all the answers

    In what context is formatted string literal (f-string) primarily used?

    <p>To format strings by evaluating variables when printed.</p> Signup and view all the answers

    What is the role of an escape sequence in programming?

    <p>To represent special characters in a string.</p> Signup and view all the answers

    Which statement accurately describes a float data type?

    <p>It includes a decimal point but may not always show it.</p> Signup and view all the answers

    What does the term 'End-of-Life' signify in technology?

    <p>The time when a product no longer receives updates or support.</p> Signup and view all the answers

    How is memory managed through Garbage Collection (GC)?

    <p>By automatically reclaiming memory from objects that are no longer needed.</p> Signup and view all the answers

    What is a function in programming?

    <p>A collection of statements executed collectively by the program.</p> Signup and view all the answers

    What does the 'evaluate' process refer to in programming?

    <p>To interpret an expression and compute its resulting value.</p> Signup and view all the answers

    What is the primary purpose of good (or best) practices in programming?

    <p>They focus on improving the readability and maintainability of code.</p> Signup and view all the answers

    What best describes the function of a disk (hard drive)?

    <p>It stores files by aligning magnetic particles along a surface.</p> Signup and view all the answers

    What defines a floating-point literal in programming?

    <p>A number written with a fractional part, even if zero.</p> Signup and view all the answers

    What is the main advantage of using a list in programming?

    <p>Lists allow you to change, append, and remove elements easily.</p> Signup and view all the answers

    What does a literal represent in a programming context?

    <p>A specific value coded directly into the program.</p> Signup and view all the answers

    In programming, what is the primary effect of having leading zeros in a number?

    <p>They can change how a number is interpreted, such as in octal representation.</p> Signup and view all the answers

    Which of the following statements best describes a line of code?

    <p>A single instruction that the computer can execute.</p> Signup and view all the answers

    What is meant by the term 'memory' in computing?

    <p>A circuit for storing temporary data represented as 0s and 1s.</p> Signup and view all the answers

    What is a keyword in the context of the Python programming language?

    <p>A term that has a specific function and cannot be used as an identifier.</p> Signup and view all the answers

    What is a common characteristic of a logic error in programming?

    <p>It leads to incorrect operation of the program despite running successfully.</p> Signup and view all the answers

    How is a list defined in Python?

    <p>By enclosing variables or literals in square brackets.</p> Signup and view all the answers

    What is the primary purpose of a disk drive?

    <p>To provide non-volatile storage for files and data</p> Signup and view all the answers

    What does the term 'overflow' specifically refer to in programming?

    <p>When a value is too large for the allocated memory</p> Signup and view all the answers

    Which characteristic accurately defines a floating-point number?

    <p>It can represent very large or very small values with decimals</p> Signup and view all the answers

    What is the purpose of escape sequences in programming?

    <p>To introduce special characters in strings</p> Signup and view all the answers

    What is a formatted string literal (f-string) primarily used for?

    <p>To format strings dynamically during execution</p> Signup and view all the answers

    How does garbage collection (GC) function in programming languages?

    <p>It frees up memory from unused objects</p> Signup and view all the answers

    What does the term 'good practices' refer to in programming?

    <p>Methods that enhance code readability and maintainability</p> Signup and view all the answers

    What occurs during the evaluation of an expression in programming?

    <p>The expression's result is calculated based on precedence rules</p> Signup and view all the answers

    What does the 'execute' term refer to in programming?

    <p>To run and carry out a specified program</p> Signup and view all the answers

    What describes the function of an element in a programming context?

    <p>A single item in a list or collection</p> Signup and view all the answers

    Which of the following best defines floating-point literals?

    <p>Numbers represented with their fractional parts</p> Signup and view all the answers

    What does 'End-of-Life' denote in technology?

    <p>When a technology is deprecated and unsupported</p> Signup and view all the answers

    What primarily characterizes a function in programming?

    <p>A modular set of statements executed when called</p> Signup and view all the answers

    What determines the outcome of a relational operator comparison between two sequences?

    <p>The first mismatching elements in the sequences</p> Signup and view all the answers

    What is typically meant by the term 'output' in programming?

    <p>Information displayed to users</p> Signup and view all the answers

    What error occurs when a value exceeds the allocated memory limits in Python?

    <p>OverflowError</p> Signup and view all the answers

    Which of the following best describes peripherals in a computing context?

    <p>Input/output devices used in a computer system</p> Signup and view all the answers

    Why is it a good practice to use parentheses in mathematical expressions?

    <p>To clarify the order of operations</p> Signup and view all the answers

    What role does the processor (or CPU) play in a computer?

    <p>Executing instructions and processing data</p> Signup and view all the answers

    What does it mean when floating-point values are referred to as limited by range in Python?

    <p>There exists a maximum and minimum representable value</p> Signup and view all the answers

    How does a processor maintain speed during operations?

    <p>Through a clock mechanism</p> Signup and view all the answers

    What does the 'presentation type' determine in programming?

    <p>How information is represented in text form</p> Signup and view all the answers

    Which component of a computer program is responsible for performing computations?

    <p>Processor</p> Signup and view all the answers

    How is a method typically called in Python?

    <p>By using dot notation with the method name and object</p> Signup and view all the answers

    What does Moore’s Law describe?

    <p>The rate at which microprocessors evolve and improve</p> Signup and view all the answers

    Which statement is true regarding Python modules?

    <p>A module can be utilized in other programs via the import statement.</p> Signup and view all the answers

    What is the purpose of naming conventions in programming?

    <p>To select names that are meaningful and easily identified</p> Signup and view all the answers

    What is true regarding string concatenation in Python?

    <p>It creates a new string without altering the original.</p> Signup and view all the answers

    What characterizes a mutable object in Python?

    <p>It can have its type or contents modified</p> Signup and view all the answers

    Which statement correctly defines a string literal?

    <p>The actual characters enclosed within quotation marks.</p> Signup and view all the answers

    What is a distinguishing feature of non-volatile memory?

    <p>It retains information even when the power is turned off</p> Signup and view all the answers

    How can you determine the length of a string in Python?

    <p>Utilize the len() function.</p> Signup and view all the answers

    Which of the following best describes an operand?

    <p>The values used in an equation</p> Signup and view all the answers

    What is an implication of string immutability in Python?

    <p>New strings are generated when changes are made.</p> Signup and view all the answers

    What does a syntax error typically indicate?

    <p>The rules of the programming language were violated.</p> Signup and view all the answers

    What does the term 'nesting' refer to in programming?

    <p>Placing commands within one another using parentheses</p> Signup and view all the answers

    What is the role of the import statement in Python?

    <p>It allows the use of functions and variables from a module</p> Signup and view all the answers

    How is a switch defined in an electronic context?

    <p>It allows electricity to flow when activated by a voltage.</p> Signup and view all the answers

    What does the term 'sunset' refer to in IT?

    <p>The planning for the removal or discontinuation of a service.</p> Signup and view all the answers

    How can you describe an operator in programming?

    <p>A symbol that performs a computational task</p> Signup and view all the answers

    What is essential for correctly using an if-else statement in Python?

    <p>Using == to compare values.</p> Signup and view all the answers

    What is indicated by the term 'name binding'?

    <p>The association of names with interpreter objects</p> Signup and view all the answers

    What does 'mutability' refer to in programming?

    <p>Whether an object's value can be altered</p> Signup and view all the answers

    Which of the following statements is true about a microprocessor?

    <p>It integrates multiple components on a single chip</p> Signup and view all the answers

    In Python, what does a module primarily do?

    <p>Encapsulates logic for readability and reuse</p> Signup and view all the answers

    What does a seed do in the random module?

    <p>Provides a starting point for generating pseudo-random numbers</p> Signup and view all the answers

    Which statement accurately describes a set in programming?

    <p>A mutable unordered collection of unique elements</p> Signup and view all the answers

    What differentiates a scripting language from traditional programming languages?

    <p>Scripting languages execute directly without the need for compilation</p> Signup and view all the answers

    What is the primary function of a script in programming?

    <p>To execute a series of instructions through an interpreter</p> Signup and view all the answers

    How is an empty string defined?

    <p>A sequence type with no elements</p> Signup and view all the answers

    What characterizes a sequence type in programming?

    <p>It can hold items in a specific order and allows index access</p> Signup and view all the answers

    Which of the following best describes scientific notation?

    <p>A way of expressing very large or small numbers efficiently</p> Signup and view all the answers

    What is the primary use of sequence-type functions?

    <p>To manipulate and manage collections such as lists and strings</p> Signup and view all the answers

    What does a statement signify in programming?

    <p>An instruction that performs an operation within a program</p> Signup and view all the answers

    Study Notes

    Absolute Value

    • Ignores whether a number is positive or negative

    Abstraction

    • Hides the details; reduces control
    • Recipe title hides steps
    • Coding functions, variables, block-based code
    • Opposite of algorithm

    Algorithm

    • Sequence of steps to solve a problem
    • Detailed steps (opposite of abstraction)
    • Step-by-step instructions

    American Standard Code for Information Interchange (ASCII)

    • Common character encoding format
    • Basic text (plain text)
    • Not formatted/created by Notepad, Doc files
    • Check Unicode values in zyBooks

    Append

    • To add something

    Application (App)

    • Same as program

    Argument (Parameter)

    • Items passed to a function
    • Separated by commas
    • Python: argument
    • Other languages: parameter

    Assembler

    • Converts assembly language to machine instructions
    • Human-readable processor instructions

    Assembly (Language Instructions)

    • Language easier for humans
    • Translated using an assembler

    Assignment Statement

    • Assigns a value to a variable
    • Uses an equal sign

    Base

    • Base 2: Binary (0, 1); digits weighted by increasing powers of 2
    • Base 10: Decimal (0-9); digits weighted by increasing powers of 10

    Basic Input/Output System (BIOS)

    • First program run on a computer
    • Sets up peripherals

    Binary Numbers

    • Usually stored in memory location 0
    • 0s and 1s

    Bits (Binary Digits)

    • Smallest unit of data a computer can store
    • Represented as 0/1, true/false, on/off, yes/no

    Byte

    • Sequence of 8 bits

    Bug (Logic Error)

    • Flawed logic in a program
    • Code that doesn't work as expected

    Cache

    • Small, fast RAM on the processor
    • Faster access than main memory

    Camel Case

    • Naming convention (separate words start with capitals)

    Case Sensitive

    • Upper and lowercase letters are treated differently

    Central Processing Unit (CPU)

    • Same as processor or microprocessor

    Clock

    • Measures and controls the speed of instructions

    Code

    • Textual representation of a program (written or typed)
    • Binary numbers, but more human readable

    Code Point

    • Unique number representing a character using Unicode

    Compiler

    • Translates high-level language to low-level machine instructions

    Computational Thinking

    • Finding solutions by breaking down problems
    • Step-by-step solutions

    Computer

    • Device with a processor interacting with memory
    • Includes personal computers, laptops, tablets, etc.

    Concatenate

    • Joining things together

    Container

    • Structure holding similar/related values

    Core

    • Processor components in an IC

    Crash

    • Abrupt and unintended program termination
    • Often due to a runtime error

    Data Type

    • Category of information

    Debugging

    • Finding and fixing program errors; troubleshooting

    Decrementing

    • Decreasing a value by a set amount (opposite of incrementing)

    Disk (Hard drive)

    • Non-volatile hardware for storing data
    • Permanent storage

    Element

    • Part of a list

    End-of-Life

    • When a product no longer receives support

    Error

    • Problem with a program, often due to syntax or runtime
      • Logic errors are bugs

    Escape Sequence

    • Two-item sequence for special characters
    • Used with backslash (e.g., \n for newline)

    Evaluate

    • Doing the math; calculating a value

    Executable

    • Sequence of machine instructions

    Expression

    • Code that returns a value when evaluated

    Execute

    • Running a program

    Identifier

    • Name given to something or a variable

    Identity

    • Unique numerical identifier for an object
    • Memory address of the object

    Immutable

    • Values cannot be changed (integers and strings)
      • Opposite of mutable

    Increment

    • Increasing a value by a fixed amount
      • Opposite of decrementing

    Incremental Development

    • Developing a program in small, incremental steps

    Input

    • Information given to a program

    Index

    • Position of a character or element in a container
      • Start from 0 (index 0, 1 ,2...)

    Integer

    • Number without a decimal

    Interpreter

    • Executes a script or program one line at a time

    Irrational Number

    • Number that cannot be expressed as a fraction

    Iteration

    • Repeating a process/section of code

    Keyboard

    • Hardware for input

    Keyword (Reserved Word)

    • Words with predefined meanings in a programming language

    Line

    • Row of code

    List

    • Sequence type container
    • Allows mixed data types
    • Mutable

    Literal

    • Specific value used in a program (e.g., 2, "abc")

    Logic Error (Bug)

    • Same as bug

    Machine Instruction

    • Program instructions represented by 0s and 1s

    Megabyte (Megabyte)

    • One million bytes

    Memory

    • Stores 0s and 1s in locations with addresses
    • Like labeled mailboxes

    Method

    • Function associated with an object

    Microprocessor

    • Processor on a single chip

    Module

    • Python code file
    • Can be imported and used in other scripts

    Moore's Law

    • Observation that computer processing power roughly doubles every two years

    Mutable

    • Values can be changed (opposite of immutable)

    Name (Identifier)

    • Name for a variable or other object

    Name Binding

    • Association of names with interpreter objects

    Naming Conventions

    • Consistent system for naming variables

    Non-Volatile

    • Data persists even when the power is off

    Number Type

    • Category that includes integers, floats, etc.

    Numeric Type

    • Data type that can be assigned mathematical operations

    Object

    • Representation of a value created by the interpreter

    Operand

    • Value or variable in a calculation

    Operator

    • Symbol that performs a calculation (e.g., +, -, *, /)

    Operating System (OS)

    • Program enabling the usage of other programs

    Output

    • Program results/response, shown to the user

    OverflowError

    • Error produced when a value is too large to store

    Peripherals

    • Input/output devices

    Precedence Rules

    • Order of operations in an expression

    Program

    • Sequence of instructions for the computer to follow

    Programming Language

    • Language humans use to write instructions for a computer

    Processor

    • Performs calculations

    Pseudocode

    • Description of a program
    • Easier for humans to read

    Pseudo-Random

    • Random values, but generated with an equation

    Runtime Error

    • Error during program execution when program attempts an impossible operation; similar to bugs but could be other errors as well

    Scientific Notation

    • Way to express extremely large or small numbers

    Script

    • Program instructions handled by an interpreter, not a compiler

    Scripting Language

    • Program created for a specific task

    Seed (Random Library)

    • Integer value used for creating random sequences
    • Ensures same random number can be reproduced if the number is needed again

    Sequence Type

    • Data type with items in a specific order

    Set (or Set Type)

    • Mutable collection of unique elements (no duplicates)
    • Unordered, therefore does not have an index position

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    Test your knowledge on fundamental computer science concepts such as absolute value, algorithms, and ASCII. This quiz covers essential terms and definitions to help you understand the building blocks of programming and computer languages.

    More Like This

    Computer Systems and Programming Basics
    14 questions
    Programming Concepts Chapter 6 Review
    20 questions
    Computer Science Principles Overview
    13 questions
    Use Quizgecko on...
    Browser
    Browser