
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
Found 33676 Articles for Programming
25K+ Views
In Python, tuples are an important data type for storing a collection of items. Sometimes, it may be necessary to print the elements of a tuple in order to understand or debug your code. In this article, we will be discussing how to print the elements of a tuple in Python. We will go over the syntax for accessing and printing tuple elements and will provide examples of how to do so. We can define a tuple in the following way − tup1 = ("this" , "is" , “a” , "tuple") tup2 = (1, 2, 3, 4, 5 ); tup3 ... Read More
32K+ Views
Tuples are an important data type in Python and are often used to store a fixed set of elements. In this article, we will be discussing how to extract the first and last elements from a tuple in Python. We will go over the syntax for accessing these elements and will provide examples of how to do so. What is a Tuple in Python? Tuples allow for the storage of several things in a single variable. One of python’s four built-in data types for storing data collections is the tuple. Unchangeable and ordered collections are called tuples. Round brackets are ... Read More
1K+ Views
In Python, a tuple is an immutable sequence type that is commonly used to store a collection of items. A python tuple is very similar to a list in python in terms of nesting, indexing and repetition but one difference is that a tuple is immutable whereas the list is mutable which means we can change the elements of a list but we cannot do the same with a tuple. One other difference is that list uses the square bracket [] for declaration but tuples use simple bracket (). In this article, we will be discussing how to create a ... Read More
3K+ Views
Dictionaries are a powerful data type in Python that allow you to store data as key-value pairs. In this article, we will be discussing how to compare elements in two dictionaries in Python. We will go over the syntax for comparing dictionary elements and will provide examples of how to do so. Dictionaries in Python In Python, a dictionary can be created by placing a sequence of elements within curly { } brackets , separated by ‘comma’ ( , ). Dictionary holds pairs of values, one being the key and the other corresponding pair element being its value. Values ... Read More

4K+ Views
A server-side scripting language that is frequently used for web development is called PHP (Hypertext Preprocessor). The server runs PHP code, which produces HTML, CSS, and JavaScript, which are then transmitted to the client's browser for rendering. Before the HTML is transmitted to the client's browser, PHP code is embedded in it and executed on the server. To add more values to an array on a button click using PHP, you can use a form with a button that, when clicked, sends a request to a PHP script that adds the new value to the array. Approaches When using PHP, ... Read More

743 Views
An array in go language is defined as the data structure that is used to store elements in contiguous memory locations. Arrays allow us to search and store elements at constant time. arrays use index to store elements which starts from 0 and goes to n – 1, where n is the length of the array. Here we will use two methods in the first method we will implement the logic in the main section of the program while in the second one we will use an external function. Method 1:Using For Loops In The Main Here we will use ... Read More

2K+ Views
In go language a long type variable is not a separate data type but it is an extension made from the integer data type to store even larger types of integers. The main difference between an int data type and long data type is that int data type is 32 bits whereas long data type is 64 bits. Syntax func typeOf (x interface{}) The typeOf() function is used to get the type of any variable. This function is present in reflect package and it takes the variable whose type is to be determined as an argument. The function then ... Read More

726 Views
Insertion sort is a simple sorting algorithm that works similarly to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. The elements from unsorted arrays are picked and placed at the correct positions in unsorted arrays, as a result, the array becomes sorted. Here we are going to learn different approaches to sorting an array in descending order using insertion sort in go programming language. Syntax func append(slice, element_1, element_2…, element_N) []T The append function is used to add values to an array slice. It takes number ... Read More

181 Views
Cyclically means that in every cycle we wish to move the array elements by one position till we get the original array again. Cyclic permutation can be useful in various matrix manipulation and linear algebra operations. In this article, we are going to see different examples to permute the elements of the array cyclically using go programming language. Syntax func append(slice, element_1, element_2…, element_N) []T The append function is used to add values to an array slice. It takes number of arguments. The first argument is the array to which we wish to add the values followed by the ... Read More

1K+ Views
In this article we will write a go language program to check if a given number is finite or not. The program uses IsInf() and IsNaN() library functions in order to check whether numbers are finite or not. Syntax func IsInf(f float64, sign int) bool IsInf() function is present in the math package. This function takes two arguments one is the floating point number that we wish to check and the other is the sign. The sign is an integer which can be greater than, lesser than, or equal to zero. If the sign is greater than zero then ... Read More