Lesson 6 Challenge 2

by nathanesa

JavaScript

var landmarks = ['Eiffel Tower', 'Big Ben', 'Borobudur', 'Sydney Opera House'];
var countries = ['France', 'UK', 'Indonesia', 'Australia'];

alert('Here are the landmarks you can choose from: ' + landmarks);
var selection = prompt('Enter number to learn the country (first is 0):');
document.write(landmarks[selection] + ' is in ' + countries[selection]);


// Below is the code for a user friendly version. User can now enter 1 for the first 
// landmark, instead of 0.

 print("USER FRIENDLY VERSION!")
# print('Here are the landmarks you can choose from...')
# print(landmarks)
# selection = input('Enter number to learn the country (first is 1): ')
# selection = int(selection) - 1
# print(landmarks[selection] + " is in " + countries[selection])