
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
867 Views
When it is required to check if a given number is an odd number or an even number using recursion, recursion can be used.The recursion computes output of small bits of the bigger problem, and combines these bits to give the solution to the bigger problem.ExampleBelow is a demonstration for ... Read More

AmitDiwan
290 Views
When it is required to display the letters that occur in both strings separately, but are not repeated, the user input is taken, and the ‘list’ and ‘set’ are used to achieve the same.A list can be used to store heterogeneous values (i.e data of any data type like integer, ... Read More

AmitDiwan
470 Views
When it is required to display the letters that are present in the first string but not in the second string, two string inputs are taken from user. The ‘set’ is used to find the difference between the two strings.Python comes with a datatype known as ‘set’. This ‘set’ contains ... Read More

AmitDiwan
2K+ Views
When it is required to create a dictionary with the key as the first character and the associated value as the word which is the starting of that character, the s’plit’ method, a dictionary and simple ‘if’ condition is used.ExampleBelow is a demonstration for the same − Live Demomy_string=input("Enter the string ... Read More

AmitDiwan
7K+ Views
When it is required to count the frequency of words that appear in a string with the help of dictionary, the ‘split’ method is used to split the values, and a list comprehension is used.The list comprehension is a shorthand to iterate through the list and perform operations on it.A ... Read More

AmitDiwan
3K+ Views
When it is required to form a dictionary with the help of an object and class, a class is defined. An ‘init’ function is defined, that assigns values to variables. An instance of the class is created, and the init function is called.ExampleBelow is a demonstration for the same − Live ... Read More

AmitDiwan
866 Views
When it is required to multiply all the elements in a dictionary, the key values in the dictionary are iterated over. The key is multiplied with the previous key, and output is determined.The dictionary is a set of key-value pairs.ExampleBelow is a demonstration for the same − Live Demomy_dict = {'Jane':99, ... Read More
Python Program to Generate a Dictionary that Contains Numbers (between 1 and n) in the Form (x,x*x).

AmitDiwan
2K+ Views
When it is required to generate a dictionary that contains numbers within a given range in a specific form, the input is taken from the user, and a simple ‘for’ loop is used.ExampleBelow is a demonstration for the same − Live Demomy_num = int(input("Enter a number.. ")) my_dict = dict() for ... Read More

AmitDiwan
2K+ Views
When it is required to concatenate two dictionaries into a single entity, the ‘update’ method can be used.A dictionary is a ‘key-value’ pair.Below is a demonstration for the same −Example Live Demomy_dict_1 = {'J':12, 'W':22} my_dict_2 = {'M':67} print("The first dictionary is :") print(my_dict_1) print("The second dictionary is :") print(my_dict_2) my_dict_1.update(my_dict_2) ... Read More

AmitDiwan
669 Views
When it is required to reverse a string without using recursion technique, simple negative indexing can be used.Indexing helps the values to access the elements at a specific index.ExampleBelow is a demonstration for the same − Live Demomy_string = str(input("Enter a string that needs to be reversed: ")) print("The string after ... Read More