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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:42:40+00:00 2026-05-26T07:42:40+00:00

i = range(0,40,1) y = 0.1 * cos((i)/20 * pi) The error I get

  • 0
i = range(0,40,1)
y = 0.1 * cos((i)/20 * pi)

The error I get is this:

TypeError: unsupported operand type(s) for /: 'list' and 'int'`

I am not sure how to remove that error. I type-casted i to int, but its a list, thus can’t be type-casted. I am following this example. http://msenux.redwoods.edu/math/python/simple.php

  • 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-26T07:42:41+00:00Added an answer on May 26, 2026 at 7:42 am

    They are using pylab’s arange, not simple python range. And this is the problem when importing *: you don’t know which method comes from where. Import just pylab and reference to all its methods/constants with pylab.. You will really love this way of programming when you’ve got several imports.

    import pylab
    i = pylab.arange(0, 40, 1) # or pylab.arange(40) will suffice
    y = 0.1 * pylab.cos(i / 20. * pylab.pi)
    

    will work.

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

Sidebar

Related Questions

when i set range of my text box i get error when i remove
Is there any sensible way of transforming this: (for ([cos-t (stream-map cos t-range)] [sin-t
Apparently Range has a method that checks if it contains a value of type
We have a range of Classic ASP applications that we are looking to port
The following range-based for loop works fine in VS2012: int values[] = {1, 2,
I have a range of tables that I have normalized for a user profile
Description According to the explain command, there is a range that is causing a
I currently have: Range(Z1).Interior.Color = RGB(255, 255, 255) But this wipes out the borders
Range range= (Range)this.workSheet.Cells[1,1]; range.AllowEdit = false; When I set the AllowEdit property to false,
What is the range of possible characters returned from this string? function base64url_encode($data) {

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.