Computer Science, asked by shayamtrehan22, 16 days ago

Suppose t1=(3,4,5,8,2,1) , Find the value of t1 [ : 4 ]​

Answers

Answered by sushant8a
0

Input :

t1 = (3,4,5,8,2,1)

print ( t1 [ : 4 ] )

Output :

3,4,5,8

Mark my answer as brainliest...

Answered by Jasleen0599
0

Python Code

t1 = (3,4,5,8,2,1)

print ( t1 [ : 4 ] )

Output:

(3, 4, 5, 8)

  • A fundamental data structure, arrays play a significant role in the majority of programming languages. They are containers in Python that can hold many items simultaneously. They are specifically an ordered collection of items where each value represents the same data type.
  • Accessing an array element is the same as using an array index. An array element's index number can be used to access it. Since NumPy array indexes begin at 0, the first element has index 0, the second has index 1, and so on.
  • The character or range of characters in a string or an item's index position in a list are returned by the Python function index(). The item you're trying to find in your list or string is the only parameter this function accepts. Regardless of whether you're looking for a string or an item in a list, the index() method employs the same syntax.

#SPJ2

Similar questions