Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 1.05 KB

File metadata and controls

27 lines (14 loc) · 1.05 KB

CHALLENGE LAB 05:

DICTIONARIES, VARIABLES, INPUT, SHEBANG

Write a script that does the following:

  1. Include a shebang line.

  2. Make your file executable with a ./

  3. Save a user's input to the variable char_name from the following question:

     Which character do you want to know about? (Flash, Batman, Superman)
    
  4. Save a user's input to the variable char_stat from the following question:

     What statistic do you want to know about? (strength, speed, or intelligence)
    
  5. Use the char_name and char_stat values to pull the appropriate value from the dictionary below.

     {"flash":{"speed": "fastest", "intelligence": "lowest", "strength": "lowest"}, "batman":{"speed": "slowest", "intelligence": "Highest", "strength": "Money"}, "superman":{"speed": "fast", "intelligence": "average", "strength": "strongest"}}
    
  6. You should return an output line that looks like this:

     flash's speed is: fastest
    

BONUS: When returning the hero's name, have it capitalized appropriately (e.g. Flash, not flash)