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 is sequence in programming?

Instructions are executed in order, one after the other.

What is selection in programming?

Code blocks are executed based on conditions (if, if-else).

What is iteration in programming?

Code blocks are repeated until a condition is met or for a specific number of times (loops).

What is the purpose of random number generation?

To introduce unpredictability and simulate real-world events in programs.

Describe the function of routers in the Internet.

Routers direct data packets between networks to ensure they reach their destination.

Explain the role of protocols in Internet communication.

Protocols are standard rules that enable computers to communicate with each other. Examples include TCP/IP, HTTP, and DNS.

What is data representation?

How data is encoded and stored in a computer system (e.g., binary, ASCII, Unicode).

What is data visualization?

Using charts and graphs to understand patterns in data.

What is data mining?

Discovering useful information from large datasets.

What is ethical computing?

Applying moral principles to the use of computers and technology, including privacy, avoiding bias, and respecting intellectual property.

How is random number generation applied in real-world scenarios?

Simulations, games, cryptography, and statistical sampling.

How is data visualization applied in real-world scenarios?

Business intelligence, scientific research, and public health monitoring.

How is cybersecurity applied in real-world scenarios?

Protecting financial transactions, securing personal data, and preventing cyber warfare.

How is the concept of variables used in a banking system?

Storing customer account balances, transaction amounts, and interest rates.

How are control structures used in traffic light systems?

To control the sequence and timing of traffic lights based on conditions (e.g., time of day, traffic volume).

How is HTML used in e-commerce websites?

To structure the content of product pages, shopping carts, and checkout forms.

How is data mining used in marketing?

To identify customer segments, predict purchasing behavior, and personalize marketing campaigns.

How is encryption used in online communication?

To protect the confidentiality of messages and data transmitted over the Internet.

How is the Internet used in education?

To provide access to online courses, research materials, and educational resources.

How is binary representation used in image processing?

Representing pixel color values for image storage, manipulation, and display.