Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

String Concatenation

string concatenation program contains first line of input contains the string a, second line of input contains the string b, third line of input contains the string c and fourth line of input contains the string t

for example, we have a=mari , b=to, c=zzo, and t=1321.

concatenate these in the order a+c+b+a and print the resulting string: marizzotomari as the output.




Write a program to enter the numbers till the user enter ZERO '0' and at the end it should display the sum of numbers entered.


bulb states pattern

bulb states pattern program contain input is a single line containing a positive integer n representing the number of rooms in the building and the output should contain n lines , each line containing the state of the bulb in the room numbered from 1 to n in the form of 0 and 1.

example:

input: 5


Matrix Rotations

You are given a square matrix A of dimensions NxN. You need to apply the below given 3 operations on the matrix A.

Rotation: It is represented as R S where S is an integer in {90, 180, 270, 360, 450, ...} which denotes the number of degrees to rotate. You need to rotate the matrix A by angle S in the clockwise direction. The angle of rotation(S) will always be in multiples of 90 degrees.

Update: It is represented as U X Y Z. In initial matrix A (as given in input), you need to update the element at row index X and column index Y with value Z.

After the update, all the previous rotation operations have to be applied to the updated initial matrix.

Querying: It is represented as Q K L. You need to print the value at row index K and column index L of the matrix A.




Sample Input 2


2

5 6

7 8

R 90

Q 0 1

R 270

Q 1 1

R 180

U 0 0 4

Q 0 0

-1


Sample Output 2


5

8

8


i want exact sample outputs




Can you explain the clear code for polynomial expression in python and add two polynomial expression in python

Find latitude and longitude of utmost 20 countries,ordered by population greater or equal to the population limit given below and have atleast one currency exclusively for themselves.(countries like Madagascar,sri Lanka but not India,USA).

Given an input undirected graph, write a program to find all articulation points in the graph. An articulation point is a vertex whose removal disconnects the graph. (Assume that the input graph is connected.) If a graph has no articulation points, it is called a

biconnected graph.


Input Format: The input is a text file which describes an undirected graph. The first line of the file specifies n & m, the number of vertices and number of edges in the graph respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points. If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1).Input in terminal taken as python main.py ./input.txt


Output Format: Print “Biconnected Graph” if the input graph has no articulation points. If articulation points are found, print the vertices which are the articulation points.


Sample Input 1:

7 8

0 1

0 2

2 1

2 3

4 2

3 5

4 6

5 6

Sample Output 1

Articulation points found:

2



Given an input undirected graph, write a program to check if the graph is two-edge connected or not. If the graph is not two-edge connected, print all the bridge edges. (Assume that the input graph is connected.)


Input Format: The input is a text file which describes an undirected graph. The first line of the file specifies n & m, the number of vertices and number of edges in the graph respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points. If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1).Code is run in terminal as python3 main.py ./input.txt


Output Format: Print YES, if the input graph is two-edge connected, NO otherwise. If printing NO, print all the bridge edges in the graph.


Sample Input 1

(for the graph shown on the right):

8 10

0 1

1 2

0 3

3 4

3 6

4 6

5 4

5 6

7 6

5 7

Sample Output 1:

NO

1 2

0 1

0 3



1.How do i write a program that prints different messages for different months of the year. 



can i get code for this

input:

4

2

3

5

7


output:2


with following steps:


Read the Input into a variable.


Now using the loop iterate in range 1 to input.


Again read the second input into the variable.


Now take the count to assign the value 0 to it.


Using loop condition iterate from range 1 to second input.


using the if condition checks the condition that the second input is divisible by number then increment the count.


If the count is equal to 2


print the number and break from the loop.