Boredless Tourist Challenge

My question is about the project walk through on youtube.

At 38:59, instead of typing out the function the professor just makes it appear.

So, I would like to know is there some keyboard shortcut or something that allows you to do this inside the text editor?

Thank you in advance for your help.

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

It’s not entirely clear since we’ve no idea what keypresses are being used and a few seconds before this there’s a “recording paused” window. I’d assume it was copy/paste as it’s rather complex- "name, assignment, function(arguments)" and the alternative is terrifying :wink:.

So far as I’m aware the standard cc environment has little to no autocompletes of any kind but you’ll find plenty in most personal IDEs/code edtiors which are often clever enough. There’s a balance to be found when you’re learning to code in doing everything yourself (even the boring bits) so as to remember things by repetition vs. what a lot of folks actually do and rely on their editors to autocomplete, flag errors and typos and keep the style consistent etc. etc. Especially when doing things the first time writing every letter yourself isn’t such a bad thing; at the end of the day it’s up to you what you choose to do though.

Thank you very much.

Yesterday, I decided to install python on sublime text editor 3. It took me really long, but once I got it working, it was really way more comfortable to code in that thing. And super fast to run the code, helping me to iterate through all the problems I was having with one of the challenges.

I really appreciate the reduction in typing also, using the autocomplete, because after typing a lot my forearms started getting stiff, so I was looking for a way to relieve that by typing less.

I just found out, if you press F1 in the code editor you get a list of all the possible commands.

1 Like

Hi
Trying to follow the instructions in The Boredless Tourist get as far as the except SyntaxError: and return
even after going through the solution guide I get the Syntax Error that just points to except and cannot get past it
any thoughts pls?

have even tried to carry on coding but cannot get pass this SyntaxError
Paul

A syntax error means there’s syntax the interpreter just doesn’t know what to do with, you cannot catch an error with exceptions since the code never even gets to the stage where it runs.

Providing the actual error code would be useful here, Python’s tracebacks tend to be quite detailed; it should point out where this error occurred. Bear in mind that certain syntax errors like unmatched parantheses may cause errors that are only noticeable in the following lines rather than the exact line.

Error code
File “script.py”, line 27
except SyntaxError:
^
SyntaxError: invalid syntax

and if I remove those lines I then get another error for my next code
which I have double checked in the guide and cannot see where I am going wrong

$ python3 script.py
File “script.py”, line 29
add_attraction(“Los Angeles, USA”, [‘Venice Beach’, [‘beach’]])
^
IndentationError: unexpected unindent

An unexpected indent suggests just that, an indent has been used where the code did not expect one, here a hacky example of this-

x = 3
    print(x)  # Here's an unexpected indent (error)

Python’s indentation rules are fairly strict, double check you’ve not added or removed indents in unexpected places.

1 Like

i am currently stuck and keep getting a value error i dont understand why

File “script.py”, line 30, in
add_attraction(“Los Angeles, USA”, [‘Venice beach’, [‘beach’]])
File “script.py”, line 25, in add_attraction
destination_index = get_destination_index(destinations)
File “script.py”, line 6, in get_destination_index
destination_index = destinations.index(destination)
ValueError: [‘Paris, France’, ‘Shanghai, China’, ‘Los Angeles, USA’, ‘São Paulo, Brazil’, ‘Cairo, Egypt’] is not in list