Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8730797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:05:57+00:00 2026-06-13T09:05:57+00:00

Here’s the problem I’m working on: Assume that the developers of Myro are developing

  • 0

Here’s the problem I’m working on:

Assume that the developers of Myro are developing a new black box
function called traveler(String str ) that moves a robot in a specific
direction (i.e., North, South, East, or West) for a specific number of
feet (e.g., 1 = one foot, 2 = two feet, etc.) The parameter of the
traveler( ) function is a String variable that expresses both the
direction and the distance. For example, traveler(E2) would move the
robot East for two feet while traveler(N6) would move the robot North
for six feet.

Write a short segment of code that uses the black box traveler( )
function to move the robot from Point A to Point B in the grid shown
below.

  1. Assign the parameters (e.g. N2, etc.) to a data structure.
  2. Traverse the data structure with a loop that supplies the parameters to the traveler( ) function.

Path to follow

The traveler(String str) function does not really exist. Treat it as
if it did and simply write a short segment of code to accomplish the
task of moving the robot along the pattern given above.

Here’s what I have:

    def main():
    go = [N2, W1, N3, E4, S1, W1, S1, E2]
    for g go:
        traveler(g)

main()

My question is how would finish this up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:05:58+00:00Added an answer on June 13, 2026 at 9:05 am

    traversing lists in python is generally done by using a for loop

    Example from python documentation:

    >>> # Measure some strings:
    ... words = ['cat', 'window', 'defenestrate']
    >>> for w in words:
    ...     print w, len(w)
    ...
    cat 3
    window 6
    defenestrate 12
    

    In the above example len is a built in function. They are passing w to the len function. This is very simliar to what you need to do with the traveler function.
    Loop through every item in go list. Pass that item to traveler

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
Here is my problem. Our tech. writer or customer service will often create new
Here is my problem.. I have the option to create(add) two new input fields,
Here's the code I have. It works. The only problem is that the first
Here's a coding problem for those that like this kind of thing. Let's see
Here is another spoj problem that asks how to find the number of distinct
Here's the sitch. I click a button and create a new PictureBox no problem.
Here is the code in a function I'm trying to revise. This example works
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here are my functions: function dropmenu() { $(.dropdownitem).show('slow'); } function hidemenu() { $(.dropdownitem).hide('slow'); }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.