Are there Python code for Scalar Multiplication, Dot Product, Norm (length) without using external library, function?
Question: Here vectors are used as Python tuples. Like the vector `[3;1;1]` is
represented in Python as `(3,2,1)`.

  1. Write a Python function sca(s,v) that takes 2 arguments: Scalar s and vector v. The function should find result of multiplying the vector by the scalar.
    
         sca(3, (1,2,3))     # Returns (3,6,9)
    

Answer may not import any modules or employ any external library functions.


Answer: There are no builtin functions specifically for this purpose - you will have
to write `sca(s, v)` yourself as the question states. The good news is that as
long as you are familiar with the mathematical definition of scalar
multiplication, this can be implemented in a very short amount of code (4
lines, 1 with some knowledge of Python's more advanced features). Think about
how to write that definition in terms of the components of the vector, instead
of the entire vector and then think about how to write that in Python.

