Ask coding questions

← Back to all posts
Ideas
[deleted]

Hello, I am working on this "Functions" repl with some useful mathematical functions. I am running out of ideas. I am a 6th grade student, so I have alot of free time after finishing my work. Does anyone have ideas? I would be more that happy to try out some ideas!

Voters
ChristianDowell
ohyea
asdjfhjasdhfelh
Yeetusdeletus12
Comments
hotnewtop
[deleted]

A function to calculate the scalar product of vectors, just an idea

[deleted]

@JacksonCowie, Thank you, I will do that

[deleted]

@JacksonCowie , I am using either
import numpy
result = numpy.dot( numpy.array(A)[:,0], B)

or

sum( [a[i]*b[i] for i in range(len(b))] )

[deleted]

@hendryxu I'd just go with the second one, no need to import a module - Unless you are going to use it again in a separate function that actually requires numpy.