zuai-logo
zuai-logo
  1. AP Computer Science Principles
FlashcardFlashcard
Study GuideStudy GuideQuestion BankQuestion BankGlossaryGlossary

What are the steps to generate a random number in Python?

  1. Import the random module. 2. Use a function like random.randint(a, b) to generate a random integer between a and b, inclusive.
Flip to see [answer/question]
Flip to see [answer/question]
Revise later
SpaceTo flip
If confident

All Flashcards

What are the steps to generate a random number in Python?

  1. Import the random module. 2. Use a function like random.randint(a, b) to generate a random integer between a and b, inclusive.

What are the steps to simulate rolling a six-sided die in pseudocode?

  1. Use RANDOM(1, 6) to generate a random integer between 1 and 6.

What are the steps to protect against phishing attacks?

  1. Be suspicious of unsolicited emails. 2. Verify the sender's identity. 3. Don't click on suspicious links. 4. Use strong passwords.

What are the general steps for data analysis?

  1. Collect the data. 2. Clean the data. 3. Analyze the data. 4. Visualize the data. 5. Draw conclusions.

What are the steps to create a secure password?

  1. Use a mix of uppercase and lowercase letters. 2. Include numbers and symbols. 3. Make it at least 12 characters long. 4. Avoid common words or phrases.

What are the steps to represent an image in a computer?

  1. Divide the image into pixels. 2. Assign each pixel a color value (e.g., RGB). 3. Store the color values as binary data.

What are the steps to connect to the Internet?

  1. Ensure you have a network interface card (NIC). 2. Connect to a network (e.g., Wi-Fi or Ethernet). 3. Configure your IP address and DNS settings. 4. Test the connection.

What are the steps to declare a variable in Python?

  1. Choose a name for the variable. 2. Assign a value to the variable using the assignment operator (=). 3. The data type is automatically inferred.

What are the steps to write a basic HTML page?

  1. Start with <!DOCTYPE html>. 2. Add the <html> tag. 3. Include <head> and <body> sections. 4. Add content within the <body> section.

What are the steps to protect your computer from malware?

  1. Install antivirus software. 2. Keep your software up to date. 3. Be careful when opening email attachments. 4. Avoid suspicious websites.

What are the differences between the Internet and the World Wide Web?

Internet: The global network infrastructure. | World Wide Web: A service that uses the Internet to access linked hypertext documents.

What are the differences between ASCII and Unicode?

ASCII: Represents characters using 7 or 8 bits. | Unicode: Represents characters using a variable number of bits (up to 4 bytes), supporting a wider range of characters.

What are the differences between positive and negative impacts of the Internet?

Positive: Increased access to information, global communication. | Negative: Privacy concerns, cybersecurity risks.

What are the differences between random.random() and random.randint() in Python?

random.random(): Returns a random float between 0.0 and 1.0. | random.randint(a, b): Returns a random integer between a and b (inclusive).

What are the differences between sequence and selection control structures?

Sequence: Instructions are executed in order. | Selection: Code blocks are executed based on a condition.

What are the differences between lossy and lossless data compression?

Lossy: Some data is lost during compression, reducing file size significantly. | Lossless: All data is preserved during compression, allowing for perfect reconstruction.

What are the differences between a client and a server?

Client: Requests services from a server. | Server: Provides services to clients.

What are the differences between a variable and a constant?

Variable: Its value can change during program execution. | Constant: Its value remains the same throughout program execution.

What are the differences between a compiler and an interpreter?

Compiler: Translates the entire source code into machine code before execution. | Interpreter: Translates and executes the source code line by line.

What are the differences between a firewall and antivirus software?

Firewall: Prevents unauthorized access to a network or computer. | Antivirus: Detects and removes malicious software from a computer.

What is a variable?

A named container that stores information which can change during program execution.

What are data types?

The type of data a variable can hold (e.g., integer, string, boolean).

What is a procedure?

A reusable block of code that performs a specific task.

What are parameters?

Inputs to procedures that allow them to operate on different data.

What are return values?

The result a procedure sends back after it completes its task.

What is the Internet?

A global network of interconnected computers that communicate using standard protocols.

What is the World Wide Web?

A system of linked hypertext documents accessed via the Internet.

What is HTML?

The language used to structure web pages.

What is binary?

The fundamental language of computers using 0s and 1s.

What is cybersecurity?

Measures taken to protect computer systems and networks from threats.