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

  • Home
  • SEARCH
  • 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 8524231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:37:51+00:00 2026-06-11T07:37:51+00:00

Hey I’m having a problem trying to figure this out: Lets start out with

  • 0

Hey I’m having a problem trying to figure this out:

Lets start out with a list with elements and a blank list.

L = [a, b, c]  
BL = [  ]

What I need to do is perform a task on L[0] and have the result put into BL[0].
Then perform a task on L[1] and have the result put into BL [1].
And then of course the same with the last element in the list. Resulting in

L = [a, b, c]
BL =[newa, newb, newc]

I hope you understand what I’m trying to figure out. I’m new to programming and I’m guessing this is probably done with a for loop but I keep getting errors.

Ok SO I here’s the what I tried. Note: links is a list of links.

def blah(links):
   html = [urlopen( links ).read() for link in links]
   print html[1]

and I get this error:

Traceback (most recent call last):
File "scraper.py", line 60, in <module>
main()
File "scraper.py", line 51, in main
getmail(links)
File "scraper.py", line 34, in getmail
html = [urlopen( links ).read() for link in links]
File "/usr/lib/python2.6/urllib.py", line 86, in urlopen
return opener.open(url)
File "/usr/lib/python2.6/urllib.py", line 177, in open
fullurl = unwrap(toBytes(fullurl))
File "/usr/lib/python2.6/urllib.py", line 1032, in unwrap
url = url.strip()
AttributeError: 'list' object has no attribute 'strip'
  • 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-11T07:37:52+00:00Added an answer on June 11, 2026 at 7:37 am

    Simple, do this:

    BL = [function(x) for x in L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
Hey There I'm trying to figure out the sql code for this: Assuming I
Hey I can't figure out an error I got. I had my App working
Hey having some trouble trying to maintain transparency on a png when i create
Hey guys I'm working with this forum, I want to hide the categories list,
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
Hey its really hard to define an exact title for my problem. I am
Hey folks I am trying to implement a search functionality in a website using
Hey I am getting this error: error: conversion to non-scalar type requested Here are
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;

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.