Write a program to print a parallelogram pattern with * characters. The size N represents the length (the number of * characters in each line)& breadth ( the number of lines) of the parallelogram.
The slope of the parallelogram T represents the number of extra spaces a line should have in the beginning compared to its next line. The last line of the pattern does not have any spaces in the beginning.
Explanation:
Given N=3 and T=2, each line should have 3 star(*) characters.
The last line should have 0 spaces at the beginning.
Each line has 2 extra spaces characters when compared to its next line.
Sample Input1
2
2
Sample Output1
**
**
Sample Input2
3
2
Sample Output2
***
***
***
You given a list of prices where prices[i] is the price of a given stock o the i th day write a program to print the maximum profit by choosing a single day to buy a stock and choosing a different day in the future to sell that stock if these is no profit that can be achieved return 0.
Input
The input is a single line containing space seperated integers.
Output
The output should be a single line integer.
Explanation
In the example the given prices are 7 1 5 3 6 4.
buying stocks on day two having price 1 and selling them on the fifth day having price 6 would give the maximum profit which is 6 - 1
so the output should be 5.
Sample Input1
1 2 1 3 6 7 4
Sample Output1
6
Create a program using Python for Eduvos based on the above scenario. The program should initially display a welcome message. The program should then do the following: 3.1 Prompt the user to enter the number of students to be captured. 3.2 Handle exceptions to ensure that the user enters a number. 3.3 Prompt the user to enter the student’s name, exam 1 and exam 2 marks. 3.4 Calculate the test average. 3.5 Use tuples to handle records. 3.6 The records should then be written to a file called studentsexammarks.txt. 3.7 The program should display the recorded test marks on the screen.
Create a maze without itertools and copy library Assign them (2, y) coordinates, where (0,0) is the upper-left corner of the map. In the example map above, we have lots of cells along the top edge; their coordinates are (0,0), (1,0), (2,0),(3,0),(4,0), (5,0),(6,0),... There are also quite a few along the left edge: (0,1),(0,2), (0,3), (0,4),(0,5).... The start point is at (4,0) and the end point is at (5,7). Required Dump Points As noted above, the "command" that the user types will tell you how far to run the algorithm, before you dump out a result. You must support the following commands; if the user types anything other than one of these (a blank line is OK), then report an error and terminate the program. For each of these commands, check the testcases to find the proper output.
Practice combining dictionaries with file input, practice with data visualization
Degree of Difficulty: Easy
1 Overview In this program, you will solve a maze. You will read the map up from a file, build a tree to represent the maze, and then search through the tree, to find a path from the start to the end. Name your program maze_solver.py
1.1 Dump Points Solving the maze takes several steps, so I've broken it into smaller pieces. For each piece, I've added a "dump" option - if I ask for that particular dump, then you will stop the algorithm at that point, print out what you have so far, and then terminate the program. I've done this for two reasons. First, I hope that it will help guide you through the solution - since each step will be relatively small. Second, if you complete only part of the algorithm but not all of it, you can still get partial credit, because we'll have testcases that will stop you, and check your code, at various points in the process. (Yes, this reduces your flexibility, and locks you into an algorithm
Check comments for complete questions
7)Write a Python program to count the number of characters (character frequency) in a string. without using function
Consider the equation and the relation “(x, y) R (0, 2)”, where R is read as “has distance 1 of”.
For example, “(0, 3) R (0, 2)”, that is, “(0, 3) has distance 1 of (0, 2)”. This relation can also be read as “the point (x, y) is on the circle of radius 1 with center (0, 2)”. In other words: “(x, y) satisfies this equation , if and only if, (x, y) R (0, 2)”.
Does this equation determine a relation between x and y? Can the variable x can be seen as a function of y, like x=g(y)? Can the variable y be expressed as a function of x, like y= h(x)? If these are possible, then what will be the domains for these two functions? What are the graphs of these two functions?
Are there points of the coordinate axes that relate to (0, 2) by means of R?
Your Discussion should be a minimum of 250 words in length and not more than 750 words.
write a program to find the sum S of the series where S = x - x^3 + x^5 + ..... upto N items.
How to use a loop(for loop or while loop) in a pseudocode algorithm?
Can I have an example?