# Calling ith dimensional Component of Vector | Linear Algebra using Python

Linear Algebra using Python: In this article, we will learn about **calling i ^{th} dimensional component of Vector**, python implementation of it.

Submitted by Anuj Singh, on May 12, 2020

Prerequisite: Linear Algebra | Defining a Vector

**Linear algebra** is the branch of mathematics concerning linear equations by using vector spaces and through matrices. In other words, a vector is a matrix in *n-*dimensional space with only one column. In the sequence of learning linear algebra using python, this is article 4. In some of the problems, we need to use a particular component of the vector.

For example: Let a vector **a = [4, 9, 7], **this is a 3 dimensional vector (x,y and z)

So, if we need to call the **y ^{th}** component of the vector, we are talking about the corresponding value

**9.**

In the python code, we will first define a vector and then we will call its 4^{th} component.

## Python code for calling i^{th} dimensional Component of Vector

# Vectors in Linear Algebra a = [3, 5, -5, 8] print("Vector a = ", a) # This is a 4-dimensional vector i = int(input("type dimensional component you want to know: ")) print("Vector's", i," dimensional component = ", a[i-1])

**Output**

Vector a = [3, 5, -5, 8] type dimensional component you want to know: 4 Vector's 4 dimensional component = 8

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.