Esayway in an online exam for new graduates of any discipline to find entry level jobs in their fields. The website generates the roll number of its registered students with the help of the students application numbers. The process induce a key K for generating an individual roll number. To generate the roll number, each digit in the application number is replaced by the Kth digits that comes after it in the application number. the series of digits is considered in a cyclic fashion for the last k digits.
write an algorithm to generate the roll number from the given application number.
Input
The input consists of two space-separated positive integers - applicant number and key, representing the application number and key (K), respectively.
Output
Print an integer representing the roll number.
Constraints
0< applicant number <= 10^9.
Example input : 432513 Output : 25143 Explanation: replace 4 with 2;3 with 5;2 with 1; 5 with 4; and 1 with 3. So, the output is 25143
Answers
Answered by
0
Explanation:
ओके आई विल सॉल्व दिस प्रॉब्लम
Answered by
0
Concept Introduction:-
Data which has been handled and organised and structured and it puts data into context and facilitates decision-making.
Explanation:-
A question has been provided to us
We need to find the solution to the question
n = input('application number: ')
k = int(input('key: '))
new_n = ''
for i in range(len(n)):
new_n += n[(i+k)%len(n)]
print(f'generated number: {new_n}')
Final Answer:-
The correct answer is the java script.
#SPJ3
Similar questions