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:
B
Explanation:
I haven't taken cs principles, but i have taken cs a
is that python?
bug, car, ear are the only words less than 4 characters in legnth
Answer:ok be how hobrhkihfehgdhdj fuiufiisefif jfkijfjfhhfhfhfhf
Explanation:
Answer:
import java.util.Scanner;
public class num8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter first number");
int X = in.nextInt();
System.out.println("Enter second number");
int Y = in.nextInt();
int Z;
if(X <= Y){
Z = 0;
}
else if(X >= Y){
Z = 1;
}
}
}
Explanation:
- The program is implemented in Java
- In order to set the values for X and Y, The Scanner class is used to receive and store the values in the variables (Although the questions says you should assume these values are set)
- The if conditional statement is used to assign values (either 0 or 1) to variable Z as required by the question.
Answer:
You can use the Import spreadsheet wizard program.
Explanation:
On the Office ribbon, select the External Data tab and click Excel. The "Get External Data - Excel Spreadsheet" wizard appears. In the File name field, browse to the Excel file. Select the "Import the source data into a new table in the current database" option and click OK.