Weekends
Given two dates D1 and D2, write a program to count the number of Saturdays and Sundays from D1 to D2 (including D1 and D2).The date in string format is like "8 Feb 2021".
Input: The first line of input will contain date D1 in the string format.
The second line of input will contain date D2 in the string format.
Output: The output should be a single line containing two integers separated by space.
Explanation: For example, if the given dates are "25 Jan 2021" and "14 Feb 2021", the Saturdays and Sundays dates from "25 Jan 2021" to "14 Feb 2021" are
"30 Jan 2021" is a Saturday
"31 Jan 2021" is a Sunday
"6 Feb 2021" is a Saturday
"7 Feb 2021" is a Sunday
"13 Feb 2021" is a Saturday
"14 Feb 2021" is a Sunday
So the output should be
Saturday: 3
Sunday: 3
Sample Input 1
25 May 2019
22 Dec 2021Sample Output 1
Saturday: 135
Sunday: 135Secret Message - 2
Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.
Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.
abcdefghij12345678910
klmnopqr1112131415161718
stuvwxyz1920212223242526
Output
The output should be a single line containing the secret message. All characters in the output should be in lower case.
Explanation
For example, if the given input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So the output should be "16-25-20-8-15-14".
Sample Input 1
pythonSample Output 1
16-25-20-8-15-14Sample Input 2
FoundationsSample Output 2
6-15-21-14-4-1-20-9-15-14-19add two polynomials given two polynomials a and b, write a program that adds the given two polynomials a and b. input the first line contains a single integer m. next m lines contain two integers pi, ci separated with space, where pi denotes power and ci denotes co-efficient of pi for polynomial a. after that next line contains a single integer n. next n lines contain two integers pj, cj separated with space, where pj denotes power and cj denotes co-efficient of pj for polynomial b.
Please help me for this i am not able to do this
3. Disarium Number
A number is said to be Disarium if the sum of its digits raised to their respective positions is the number itself.
Example:
75
7^1+5^2=7+25=32 → False
135
1^1+3^2+5^3=1^9+125=135 → True
Print True if a number is a Disarium, otherwise print False.
Input
The Input will be any integer
135
Output
True
add two polynomials given two polynomials a and b, write a program that adds the given two polynomials a and b. input the first line contains a single integer m. next m lines contain two integers pi, ci separated with space, where pi denotes power and ci denotes co-efficient of pi for polynomial a. after that next line contains a single integer n. next n lines contain two integers pj, cj separated with space, where pj denotes power and cj denotes co-efficient of pj for polynomial b.
How to print 0 in the code for this question since i am trying this question from last 1 mnth i am not passing test casses please help me to do this