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

n = int(input())
line = []

for i in range(0, n):
    line.append(input())
    print(max(line))
#test cases failed

Develop a custom class called Contact(Name, Dob, Phonenumber) which has methods such as Read() and Display() with the following criterions. Read Name (Text: maximum length 50), Dob(Date: after 01/01/2000) and



Phone numbers(Integer) from user and some of these accepting only a specific format with the four-digit area and six-digit local codes accepted as ten digits, or separated into blocks using hyphens or spaces, and with the area code optionally enclosed in parentheses.



For example, all of these are valid: 0426-123-456, (0432) 123456 and 0432



123456.



Read the phone numbers from console and for each one echo the number in the form "(999) 999 9999" or report an error for any that are invalid, or that don't have exactly ten digits.



Show how the object creations and manipulations are done for 'N' valid



Contacts.



Finally store the contacts in a separate .csv file

Write a program to print the following output


Input

The input is a single line string S.



Explanation

The input should be MATHEMATICS.

The output should be M A T H E I C S.


Sample Input1

MATHEMATICS

Sample output1

M A T H E I C S


Reverse of a number using recursion in python


Math Quiz


Write a program to print the following


Sample Input 1

1 3 4 5 6

5

3 5

Sample Output1

12



code for denominations 100, 50,10,1


 In a class test the teacher announces the marks (negative marking is allowed) of n (n>0) students. A student can achieve maximum 100 marks. Write a python function print_marks(*marks)  that takes number of students, marks of students and return the marks and check the marks are valid or not. If valid then it calls the recursive function rec_Sort(*marks) which returns the students marks as a comma-separated string with elements in ascending order. (You can use of built-in function max ()/min() to do this).

Example-1

Example-2

Example-3

Example-4

Example-5

Input:

5

6

56

58

 

Output:

5, 6, 56, 58

 

Input:

12

-3

45


37

90

Output:

-3, 0, 12, 37, 45, 90

Input:

56

96

100

101

Output:

Invalid Input

Input:

56

196

20

10

Output:

Invalid Input

Input:

50

40

10


Output:

0, 10, 40, 50

 




Construct a class named student consisting of a student identification number, list of five grades, and an integer representing the total value of grades entered. The constructor for this class should initialize all student data members to zero. Included in the class the functions/ methods for:


1. Constructor and a Destructor.


2. Create an assessor method to enter a student number


3. Create a method to enter a single test grade (used loop for entering 5 grades)


4. Create a mutator method – to computer an average grade


5. Create a method to display the student number and average grade.


class Student:

  # Constructor

  def _init_(self):

    self.id_number = 0

    self.grades_list = []

    self.grades_total = 0



Maximum Profit


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 an 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 input 1

7 1 5 3 6 4

sample output 1

5


sample input 2

1 11 13 21 19

sample output 2

20