
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
176 Views
ProblemWe are required to write a JavaScript function that takes in a string of some mathematical operation and return its literal wording.ExampleFollowing is the code −const str = '5 - 8'; const convertToWords = (str = '') => { const o = { "+" : "Plus", ... Read More

AmitDiwan
354 Views
When it is required to find the closest pair to the Kth index element in a tuple, the ‘enumerate’ method can be used along with ‘abs’ method.Below is the demonstration of the same −Example Live Demomy_list = [(5, 6), (66, 76), (21, 35), (90, 8), (9, 0)] print("The list is ... Read More

AmitDiwan
885 Views
When it is required to create a list from a given list that have a number and its cube, the list comprehension can be used.Below is the demonstration of the same −Example Live Demomy_list = [32, 54, 47, 89] print("The list is ") print(my_list) my_result = [(val, pow(val, 3)) for ... Read More

AmitDiwan
1K+ Views
When it is required to find the maximum and minimum K elements in a tuple, the ‘sorted’ method is used to sort the elements, and enumerate over them, and get the first and last elements.Below is the demonstration of the same −Example Live Demomy_tuple = (7, 25, 36, 9, 6, 8) ... Read More

AmitDiwan
372 Views
When it is required to find the size of a tuple, the ‘sizeof’ method can be used.Below is the demonstration of the same −Example Live Demoimport sys tuple_1 = ("A", 1, "B", 2, "C", 3) tuple_2 = ("Java", "Lee", "Code", "Mark", "John") tuple_3 = ((1, "Bill"), ( 2, "Ant"), (3, "Fox"), ... Read More

AmitDiwan
255 Views
ProblemWe are required to write a JavaScript function that takes in two strings. The first string specifies the user name and second the owner name.If the user and owner are the same our function should return ‘hello master’, otherwise our function should return ‘hello’ appended with the name of that ... Read More

AmitDiwan
587 Views
ProblemWe are required to write a JavaScript function that takes in an array of numbers of length at least three.Our function should simply return the third smallest number from the array.ExampleFollowing is the code − Live Democonst arr = [6, 7, 3, 8, 2, 9, 4, 5]; const thirdSmallest = () ... Read More

AmitDiwan
154 Views
ProblemWe are required to write a JavaScript function that takes in a string that contains only ‘A’, ‘B’ and ‘C’. Our function should find the minimum number of characters needed to be removed from the string so that the characters in each pair of adjacent characters are different.ExampleFollowing is the ... Read More

AmitDiwan
198 Views
ProblemWe are required to write a JavaScript function that takes in a string of English alphabets.Our function should count the number of rings present in the string.O', 'b', 'p', 'e', 'A', etc. all have one rings whereas 'B' has 2ExampleFollowing is the code − Live Democonst str = 'some random text ... Read More

AmitDiwan
424 Views
When it is required to find the keys associated with specific values in a dictionary, the ‘index’ method can be used.Below is the demonstration of the same −Example Live Demomy_dict ={"Hi":100, "there":121, "Mark":189} print("The dictionary is :") print(my_dict) dict_key = list(my_dict.keys()) print("The keys in the dictionary are :") print(dict_key) dict_val ... Read More