A player needs to collect a map and a shovel to look for the treasure. The following code check if the player is ready to look for the treasure or still needs to find the shovel, map or both. What message will be displayed if has_shovel = false and has_map = true?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 5GZ
icon
Related questions
icon
Concept explainers
Question

A player needs to collect a map and a shovel to look for the treasure. The following code check if the player is ready to look for the treasure or still needs to find the shovel, map or both. What message will be displayed if has_shovel = false and has_map = true?


if has_shovel and has_map:
print("Look for the treasure")
elif has_shovel:
print("Try looking near the cliff")
elif has_map:
print("Try looking behind the forest")
else:
print("Try looking behind the forest and near the cliff")
 

Question 7 options:

 

Try looking behind the forest and near the cliff

 

Try looking near the cliff

 

Try looking behind the forest

 

Look for the treasure

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning