CS
  • Home
  • Languages
    • Python >
      • Basics
      • Conditions & Loops
      • Functions and Modules
      • Other Data Types
      • Errors and Exceptions
      • Projects
    • C + + >
      • Basics
      • Functions
      • Conditions & Loops
  • Programs
  • About

Other Data Types

1 - Lists
3 - Dictionaries
2 - Strings As lists
4 - Tuples
Exercises
  • Write a program that uses a list of colors to guess a person's favorite color
  • Program that finds the frequency of letters in a word and returns a dictionary

Possible Solutions

Write a program that uses a list of colors to guess a person's color
  • Random Module for random guessing - Randomness in computers is not really random. Randomness is created using a complex algorithm that starts with a value, but eventually a pattern emerges when the starting value or seed is returned. SystemRandom() is used to change the seed, so that the program has a less noticeable pattern.
  • Display the possible colors and have the user pick one.
  • Time module so delay print statements (More Interactive)
Code Editor

    

Program that finds the frequency of letters in a word and returns a dictionary
Code Editor

    
Powered by Create your own unique website with customizable templates.
  • Home
  • Languages
    • Python >
      • Basics
      • Conditions & Loops
      • Functions and Modules
      • Other Data Types
      • Errors and Exceptions
      • Projects
    • C + + >
      • Basics
      • Functions
      • Conditions & Loops
  • Programs
  • About