Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, December 17, 2012

LearnStreet Sample Solution to Lesson 7 Exercise 9



# This function should return:
# 1. "steak" if celebrity is "brad pitt" or "angelina jolie"
# 2. "italian" if celebrity is "ashton kutcher" or "demi moore"
# 3. "french" if celebrity is none of the above
def dinner_choice(celebrity)
#your code here
    if celebrity == "brad pitt" || celebrity == "angelina jolie"
        "steak"
    elsif celebrity == "ashton kutcher" || celebrity == "demi moore"
        "italian"
    else
        "french"
    end  
end

dinner_choice("bruce willis")

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts