Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class for Vector
#4
You need to dedent line 12 - i.e. you want to return dot_product only after the for loop ended.

I understand that this is homework and you need to do what you are asked to do. However, for your information, using get function like this get_vector is not pythonic. i.e. you can just access the a property (of cource you want more meaningful name)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Class for Vector - by no_named_nobody - Oct-06-2019, 02:16 PM
RE: Class for Vector - by buran - Oct-06-2019, 02:44 PM
RE: Class for Vector - by no_named_nobody - Oct-06-2019, 02:50 PM
RE: Class for Vector - by buran - Oct-06-2019, 02:57 PM
RE: Class for Vector - by no_named_nobody - Oct-06-2019, 03:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  vector field plots Larssauerkraut 0 1,545 Oct-15-2019, 11:15 AM
Last Post: Larssauerkraut
  Divide a vector Langosmon 1 2,705 May-13-2018, 09:09 AM
Last Post: ThiefOfTime
  Classification by support vector method qwerty 1 2,957 Apr-16-2017, 07:16 PM
Last Post: sparkz_alot
  vector sum of tuples roadrage 7 7,716 Nov-28-2016, 09:54 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020