Python list is one of the most frequently used datatypes. A list is used to hold a group of elements. These elements are placed inside a square bracket separated by commas. Python list can hold items of different datatypes e.g. a list can have items of type 'integer', 'float', 'string' etc.
ReadPython program to find the sum of all odd numbers and even numbers in a list. The program will ask the user to enter the size of the list first. Then, it will ask each number to add to the list one by one. Finally, the program will calculate and print out the sum of all odd numbers and even numbers in the list.
ReadA python dictionary is a collection of key-value pairs. All keys in a python dictionary should be different.No two keys can have the same name. But for different keys, we can have the same 'value'. This tutorial is to show you how we can find all keys in a python dictionary with the same value.
ReadIn this python programming tutorial, we will learn how to delete all files with a specific extension in a folder recursively.
ReadRenaming of a directory or file is always required if you are dealing with the filesystem. Note that the filesystem works differently on different platforms. Even if you are developing applications for mobile platforms (Android or iOS), it will be different.
ReadThe Vector class in Java implements a growable array of objects. Unlike arrays, the vectors can grow or shrink as required. Accessing an element in a vector is same as like arrays. We can use the index position to access it.
ReadIn this tutorial, we will learn how to find if a number is odd or even using Bitwise operator. We know that if a number is divisible by 2, it is an even number and if not it is called an odd number. We can easily divide the number by 2 and check if it is odd or even using a modulus, but in this tutorial, we will learn how to use one bitwise operator to find out the same.
ReadIn this tutorial, we will learn how to print a random number in a range in C. In our program, the user will enter the lowest and the highest number and it will print out five random numbers in this range.
ReadIn this tutorial, we will swap two numbers using one macro and without using a third number. We are using the bitwise operator to swap these numbers.
ReadIn this tutorial, we will learn how to take inputs for arrays from a user and print the arrays using a separate function.The program will take the inputs of two arrays from the user first. The user will define the size of the arrays. Next, we will pass the arrays to a separate function by reference. This new function will print both arrays one by one.
Read