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 6090451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:12:55+00:00 2026-05-23T12:12:55+00:00

I solved a problem on Project Euler but it took about 4 minutes to

  • 0

I solved a problem on Project Euler but it took about 4 minutes to run, which is above the recommended time, so I was looking through the different solutions in the forum. One of them included the symbol << in a list comprehension. This is what it looked like

blist.extend([(i << 1) + 3 for i in range(num) if alist.get(i)])  

I can’t find anywhere what exactly this << symbol does. Can someone help me?

  • 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-05-23T12:12:56+00:00Added an answer on May 23, 2026 at 12:12 pm

    It’s a bit shift operator (Python docs), and is common among many programming languages, such as C, Java, PHP, etc. According to the Python docs:

    They shift the first argument to the
    left or right by the number of bits
    given by the second argument.

    A right shift by n bits is defined as
    division by pow(2, n). A left shift by
    n bits is defined as multiplication
    with pow(2, n). Negative shift counts
    raise a ValueError exception.

    So in your specific case, i << 1 means left shift by 1 bit, which is equivalent to multiplying by 2^1, or just 2.

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

Sidebar

Related Questions

I solved Problem 10 of Project Euler with the following code, which works through
I just solved the first problem from Project Euler in JavaFX for the fun
I'm looking at Pavel's solution to Project Euler question 24, but can't quite work
I'm trying to work through Project Euler and I'm hitting a barrier on problem
I tried to solve problem# 276 from Project Euler , but without success so
I did this problem [ Project Euler problem 5 ], but very bad manner
This is fairly 'math-y' but I'm posting here because it's a Project Euler problem,
Beginner Haskell learner here. I've solved Project Euler Problem 1, sum of multiples of
I'm attempting to solve the Project Euler Problem 8 with C++, and the problem
From Project Euler, problem 45: Triangle, pentagonal, and hexagonal numbers are generated by the

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.