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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:52:57+00:00 2026-05-21T19:52:57+00:00

hh=[[82.5], [168.5]] N=1./5 ll=N*hh What I’m doing wrong? I received error : can’t multiply

  • 0
hh=[[82.5], [168.5]]
N=1./5
ll=N*hh

What I’m doing wrong? I received error :

“can’t multiply sequence by non-int of
type ‘float'”

I try to add float(), but this is not solve my problem;

I need to multiply each element in array…
thanks to all


**Ok thanks for idea for number * array, but how to multiply array*array, I tried same as number*array, but have problems:

EDIT 2:**

hh=[[82.5], [168.5]]
N=zip(*hh)
ll = [[x*N for x in y] for y in hh]

???

  • 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-21T19:52:58+00:00Added an answer on May 21, 2026 at 7:52 pm

    When you multiply a sequence by X in Python, it doesn’t multiply each member of the sequence – what it does is to repeat the sequence X times. That’s why X has to be an integer (it can’t be a float).

    What you want to do is to use a list comprehension:

    hh = [[82.5], [168.5]]
    N  = 1.0 / 5
    ll = [[x*N for x in y] for y in hh]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HttpGet request = new HttpGet(https://192.168.1.140:8732/...); I wonder why I can only send successfully for
I installed mysql server on linux box IP = 192.168.1.100 but when i try
Method 1: InetAddress addr = InetAddress.getByName(192.168.0.101); int port = 18250; Socket socket = new
I am getting the following error running make : Makefile:168: *** missing separator. Stop.
looking for some help:) http://69.65.3.168/~doubleop/pro.sperity/blog is the site i am working on, you can
I'm try to run this script: hostname = '192.168.3.4' port = 22 username =
IP_ADDR=192.168.1.128 printf '%02X' ${IP_ADDR//./ }; echo Can some one explain how this simple oneliner
i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this
I am writing a JSR-168 portlet that can be added to a container multiple
FromIp contains 192.168.1.1 . I want to get the last number, but I can't

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.