Python Answers

Questions answered by Experts: 5 288

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

write a python function Check_Exception(index, *list)(Refer RollNo_W10A_1.py) which accepts an index value to access the list element and a list composed of numbers. Your function should produce the required element while taking care of the following cases via exception handling as shown in the example.



When the given index value is out of range on the input list.


When the index value is not an integer.


When no value is provided.

Given an integer N, write a program to print a number diamond of 2*N-1 rows as shown below.



Explanation:



In the given example,the number of rows in the diamond is 4.



So,the output should be



. . . 0 . . .



. . 0 0 0 . .



. 0 0 0 0 0 .



0 0 0 0 0 0 0



. 0 0 0 0 0 .



. . 0 0 0 . .



. . . 0 . . .





Given a integer N as a string number and K as input, write a program to print a number pyramid of K rows



Input


The first line of input is an integer N


The second line of input is an integer K



If N=10,K=5


The output should be


10


11 12


13 14 15


16 17 18 19


20 21 22 23 24



Given an integer N as a string number and K as input, write a program to print a number pyramid K rows


create a program that determines the type of medal of the total score.The users enters 3 scores from 3 sorts. 10 points is the highest scorein a sport



Given an input undirected graph, write a program to find all articulation points in tgraph. An

articulation point is a vertex whose removal disconnects graph. (Assume that input graph is

connected.) If a graph has no articulation points, it is called a biconnected graph.

Input Format: input text file which describes an undirected graph. first line of file

specifies n & m, number of vertices and number of edges in the graph respectively.next m

lines specify the m edges of graph, one line per edge. An edge is described by its end points. If

number of vertices is n, assume vertices of graph are numbered (0,1,..n-1).

Output Format: Print “Biconnected Graph” if input graph has no articulation points. If

articulation points are found, print vertices articulation points.


Sample Input 1 (for graph shown on the right):

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

Sample Input 2 (for the graph shown on the right):

4 4

0 1

1 2

2 3

3 0

Sample Output 2

Biconnected Graph


Problem 1: 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). 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 Sample Input 2 (for the graph shown on the right): 8 12 0 1 0 2 0 6 1 3 1 7 2 3 2 4 3 5 4 5 4 6 5 7 6 7 Sample Output 2: YES


Create a min-heap . write function to insert a new number in min-heap . write function to delete its minimum element . write function to delete a given element from min-heap . write function to sort it in descending order .


single digit numbers


Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in this format:


LATEST TUTORIALS
APPROVED BY CLIENTS