id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

amgreyson@gmail.com algebra-1 > hatDecision
prev  |  next  |  chance

Ms. Yamagata loves the Giants! When she's watching a home game, she wears her lucky orange hat with black lettering. When she's watching an away game, she wears her lucky black hat with the orange lettering. Given a string (either "home" or "away"), return "orange" if the Giants are playing a home game or return "black" if they are playing an away game.


hatDecision('home') → 'orange'
hatDecision('away') → 'black'

...Save, Compile, Run (ctrl-enter)

def hatDecision(str):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 125 Post-solution available

Copyright Nick Parlante 2017 - privacy