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

In the given example, D = Monday.As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will be Sundays (A week has 7 dats). So the 16th day (N = 16) of the month will be Tuesday.


Sample Input:

Monday

16


Sample Output:

Tuesday


 Suppose there is class of 10 students who have CGPA between 0-10. The university has decided to give the grace for those students those who have the CGPA between 4.5 to 4.9 to make it 5. Identify the students those have CGPA after adding the grace marks. Suppose students have its Roll_no & CGPA. Add the grace CGPA to the obtained CGPA of student by adding grace of 5 marks into the students through list comprehensions. Input Format- The input should contains an array of roll_no,and CGPA of the students. Constraints- CGPA must lies between 1.0 to 10.0 otherwise print "invalid input" Output Format- For each test case, display the roll_no and increased CGPA of those students only who lies between the obtained CGPA of 4.5-4.9


Create a program that will accept three numbers as inputs and then specifies which of them has the greatest value.

if input is rock, paper two player are plaing hand game how to write a program 

You can approximate n by using the following summation:


n=4(1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + ..... + (-1)i + 1/2i - 1





Write a program that displays the n value for i = 10000, 20000, … and 100000.



Program Output:


3.1414926535900345


3.1415426535898248


3.141559320256462


3.1415676535897985


3.1415726535897814


3.141575986923102


3.141578367875482


3.1415801535897496


3.1415815424786238


3.1415826535897198

Radioactive decay of radioactive materials can be modeled by the equation


A=A0e–t(In2/h), where


A is the amount of the material at time t, A0 is the amount at time 0, and h is the half-life.



Technetium-99 is a radioisotope that is used in imaging of the brain. It has a half-life of 6 hours.


Your program should display the relative amount A/A0 in a patient body every hour for 24 hours after receiving a dose.



Note:


With the aid of formatting techniques documented in your note, ensure your program output matches that given below.



Program Output


1: 0.890899


2: 0.793701


3: 0.707107


4: 0.629961


5: 0.561231


6: 0.500000


7: 0.445449


8: 0.396850


9: 0.353553


10: 0.314980


11: 0.280616


12: 0.250000


13: 0.222725


14: 0.198425


15: 0.176777


16: 0.157490


17: 0.140308


18: 0.125000


19: 0.111362


20: 0.099213


21: 0.088388


22: 0.078745


23: 0.070154


24: 0.062500

write a program to read the mobile number in human form. The 10 digit mobile number should be divide into 4-3-3 format . If it has continues 4 numbers it should be pronounced as quadruple , 3 numbers as thriple , 2 numbers as double.

input:- 9977222208

Here system should divide itself in 4-3-3 format like 9977 222 208

output: double nine double seven thriple two two zero eight

input:- 1111999228

output:- quadruple one thriple nine double two eight


given a sentence , swap the occurrences of the most frequent letter which the least frequent letter and vice-versa. note : .consider upper and lower case letters as different. if there are multiple letters with the same frequency , choose the lowercase letters that comes earliest in dictionary order. if letter like S and B have same frequency consider X. if letter like X and b have same frequency consider b.?

in the example the sentence is Nice Day.

the previous letter of N is M, similarly replace each letter with the previous letter

N i c e D a y

M h b d C z x

so the output should be Mhbd Czx

sample input 1

Nice Day

sample output 1

Mhbd Czx

sample input2

Be good and do good

sample output2

Ad fnnc zmc cn fnnc


in the example there are 6 numbers 1,-2,3,-4,-5,6

the negative numbers in the given list are -2,-4 and -5 where the -2 is replaced with corresponding last positive number encountered which is 1.similarly -4 and -5 are replaced with 3

so the output should be 1 1 3 3 3 6

sample input1

1 -2 3 -4 -5 6

sample output1

1 1 3 3 3 6

sample input2

1 11 -13 21 -19

sample output2

1 11 11 21 21


LATEST TUTORIALS
APPROVED BY CLIENTS