Computer Science, asked by abdiq2020, 9 months ago

Take an array of 10 elements. Split it into middle and store the elements in two different arrays. E.g.-
INITIAL array :
58 24 13 15 63 9 8 81 1 78

After spliting :
58 24 13 15 63
9 8 81 1 78

Answers

Answered by singhrohitkumar4298
5

Answer:

program using buffered reader class

Explanation:

please mark as brinlest

Attachments:
Answered by poojan
28

Language using: Python programming

In python programming, a list acts as an array that takes in any values. However, you can manipulate it to a specific type too.

Program 1: (Pre-defined list)

listt = [58, 24, 13, 15, 63, 9, 8, 81, 1, 78]

l1 = listt[:5]

l2 = listt[5:]

print(l1)

print(l2)

Output:

[58, 24, 13, 15, 63]

[9, 8, 81, 1, 78]

Program 2: Taking elements as input in a line, and printing output in the given format.

listt = list(map(int, input(). split(' '))) #or you can use range and run a loop

l1=list[:5]

l2=list[5:]

print(' '.join(l1))

print(' '.join(l2))

Input:

58 24 13 15 63 9 8 81 1 78

Output:

58 24 13 15 63

9 8 81 1 78

Learn more:

1. Write a Python function sumsquare(l) that takes a nonempty list of integers and returns a list [odd,even], where odd is the sum of squares all the odd numbers in l and even is the sum of squares of all the even numbers in l.

brainly.in/question/15473120

2. Python program to find absolute difference between the odd and even numbers in the inputted number.

brainly.in/question/11611140

Similar questions