Answer:
Following are the code to this question:
l= []#defining an empty list
n=int(input("Enter total element you want to insert: "))#defining variable to input total element
for i in range(0,n):# defining loop to input value in list
insert=int(input())#defining variable insert to input value
l.append(insert) # adding the elemenents into the list
x=n//2#calculating midpoint
l1 =l[:x]#using slicing to hold first-half value in l1 list
l2 =l[x:]#using slicing to hold second-half value in l2 list
print("Before interchange: ")#print message
print ("list : ",l)#print input list
l3=l2 + l1#add value in l3
print("After interchange: ")#print message
#print(l3) #print list l3
print (str(l3)[1:-1])#print list l3
Output:
please find the attachment.
Explanation:
Description of the code:
- In the above python program, an empty list l is declared, in the next line, variable n is defined, that input the total number of the list elements. In the next line, the for loop is declared, which uses the insert variable input value and used the append method to add value in the list.
- In the next step, the variable x is declared, which finds the midpoint of the list, and defines the l1 and l2 lists, that use slicing to hold the first and second half values.
- In the last step, the l3 list is declared, that adds the l1 and l2 lists and use the print method to print its values.
Answer:
False
Explanation:
The RAM does lose its memory when you turn off the computer, unlike hard drive which is slower but keeps memory
Answer:
yes you should get a 10 bc it not to much and u can still get something cool
Answer:
it will be ethernet and wireless network adapter
Explanation:because, wireless card is will able to connect to network wirelessly ,ethernet card will connect to network with ethernet cable RG45
if you give more info about your question will; try to help you better.
Thanks
Answer:
Program.java
import java.util.Scanner;
public class Program {
public static boolean isPalindrome(String str){
int start = 0, end = str.length()-1;
while (start < end){
if(str.charAt(start) != str.charAt(end)){
return false;
}
start++;
end--;
}
return true;
}
public static int countPalindromePairs(String[] inarr){
int count = 0;
for(int i=0; i<inarr.length; i++){
for(int j=i+1; j<inarr.length; j++){
StringBuilder sb = new StringBuilder();
sb.append(inarr[i]).append(inarr[j]);
if(isPalindrome(sb.toString())){
count++;
}
}
}
return count == 0 ? -1 : count;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.next();
String[] inarr = line.split(",");
int count = countPalindromePairs(inarr);
System.out.println("RESULT: "+count);
}
}
Explanation:
OUTPUT: