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

closest even digits number:


Given an integer N, write a program to print the closest number that has all the even digits. Consider the lowest number if there is same difference between forward and backward numbers.


Input:


The input is a single line containing an integer N.


Output:


The output should be a single line containing the closest integer , that has all even digits.


Explanation:


In the example, the number is 17. The closest number that has all even digits in it is 20. So the output should be 20.

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 Jan 2021

14 Feb 2021

Sample Output 1

Saturday: 3

Sunday: 3


Consider a schedule with 4 transactions with 1, 2, 3, and 4 operations respectively. Calculate the possible



number of



a) Serial schedules



b) Non serial schedules

Consider the following relation with set of functional dependencies



R(ABCDEF)



ABC->D, ABD->E, CD->F, CDF->B, BF->D



a) Identify the candidate key(s) in the relation (with proper steps followed).



b) Identify which normal form this relation is in and reason for the answer.

in the example the first test case number is 9966777819 and this number should be divided into 4 3 3 format

the first divided part should be read a double nine double six. As there are two consecutive 9's,it should be read as double nine.similarly there are two consecutive 6's it should be read as double six

in the second divided part there are three consecutive 7's it should be read as triple seven.

In the third divided part there are no consecutive digits each digit should be read separately.

sample input1

9966777819

sample output1

double nine double six triple seven eight one nine

sample input 2

7299613014

sample output 2

seven two double nine six one three zero one four


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


Write a program that reads a string and returns a table of the letters of the alphabet in

alphabetical order which occur in the string together with the number of times each letter

occurs. Case should be ignored. A sample output of the program when the user enters the data

“ThiS is String with Upper and lower case Letters”, would look this this:


a 2

c 1

d 1

e 5

g 1

h 2

i 4

l 2

n 2

o 1

p 2

r 4

s 5

t 5

u 1

w 2


I want a very simple code


) Computing the performance of your student class. a) Receive an integer number from user that represents the number of students that he/she has. b) Receive the grades of each student and append them to list call it grades. c) Display for him/her the maximum, minimum, and average grade. d) Display for him/her how many students have the grade between 8-10, 5-7, and below 5


Type the statements below into your Python interpreter. For each statement, copy the output into your Discussion Assignment and explain the output. Compare it with any similar examples in the textbook, and describe what it means about your version of Python. 

>>> print 'Hello, World!'

>>> 1/2

>>> type(1/2)

>>> print(01)

>>> 1/(2/3) 


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