FAQ: Code Challenge: Lists - More Frequent Item


#1

This community-built FAQ covers the “More Frequent Item” exercise from the lesson “Code Challenge: Lists”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science
Data Science

FAQs on the exercise More Frequent Item

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

stuck with the last few questions in this course. Everytime I try and use 1st as an element name I get a syntax error until I change it to first or something similar. Is it an issue with the course or is there a different way to declare a parameter starting with an integer?


#3

Hi seanos90!

I don’t think I have thought or tried to use a number in a variable like this yet. These types of questions :definitions and rules are easy to look up on the internet. Since I haven’t come across this yet (as a newer learner myself) I did some research, and it appears that you can’t have a variable start as a number.

The Rules

  • Variables names must start with a letter or an underscore, such as:
    • _underscore
    • underscore_
  • The remainder of your variable name may consist of letters, numbers and underscores.
    • password1
    • n00b
    • un_der_scores
  • Names are case sensitive.
    • case_sensitive, CASE_SENSITIVE, and Case_Sensitive are each a different variable.

Try to use an underscore before your _1st and see if that will work. The internet is pretty easy to find things like this. Thanks, I learned something new as well!


#4

This is why we recommend not using l as a variable, it can be confused with 1.

lst

is a common name given to list objects in sample and exercise code. That is, elle-ess-tee, not one-ess-tee.

As mentioned above, variable names may not begin with a number, but may contain a number.


#5

Thank you for your reply :slight_smile: and Completely get that now, I ended up googling it too after a few more tries. I just don’t get why codecademy would use 1st in the exercises?


#6

The one looks like an elle, but if we check the lesson, I’m betting it is lst, not 1st.

The why of it is representative of list, but we should avoid using reserved words as variable names so the author wrote, lst. Other authors make it more obvious by using, my_list or alist, etc.


#7

I make it obvious by using a font where different characters look different