python

Swift 4 tutorial : Creating a multidimensional array

In this tutorial, we will learn how to create a multidimensional array in Swift 4. Multidimensional array means array of arrays. That is each element of an array is also an array. Let's take a look how to create multidimensional array in swift :.

Read
swift

How to run a piece of code on main thread in Swift 4

While running a code on background thread, sometimes we need to push a code on to the main thread. In this tutorial, we will learn how to achieve this while developing ios apps in Swift 4 . Let's take a look :.

Read
swift

Swift 4 tutorial : continue statement

Suppose your program has a loop ( for or while ) and you want to skip some specific conditions, i.e. you don't want to run the code inside the loop for these conditions. 'continue' statement is used for that. It informs the loop to stop for that iteration and continue from the next iteration. In this tutorial , we will check different use cases of 'continue'. 'The syntax used for 'continue' is :.

Read
python

shutil module in python 3 with examples

shutil module contains a number of different file operations like copying and deleting files. But one thing we should remember that methods of this module cannot copy all file metadata . On windows, file owners, ACLs and alternate data streams will not be copied. Let's take a look into some uses of this module :.

Read
python

Python 3 program to check if a string is pangram or not

In this tutorial, we will learn how to check if a string is pangram or not using python 3. A pangram string contains every letter of a given alphabet.

Read
python

How to use Hashlib to encrypt a string in python

Hashlib module contains different types of secure hash algorithm methods. You can use these methods directly to create hash of different values. In this tutorial we will learn how to use hashlib module with a simple example.

Read
python

getattr in Python 3 with example

getattr is used to get the attribute of an object. We can also pass one default value to print if the attribute is not found.Before going in details, let's take a look into the following program :.

Read
python

Python program to count the number of words in a file

In this python programming tutorial, we will learn how to count the number of words in a text file.The program will take the file path and print the total word count.

Read
python

Python 3 program to check if a number is positive, negative or zero

In this tutorial, we will learn how to test if a number is positive or negative. We will also check if the number is zero.This is a beginner-friendly python tutorial. With this example, you will learn how to read a user input, how to put your code in a different method to organize it, and how to use an if, else-if, else condition.

Read
python

*args and **kwargs in Python and difference between them

In this python tutorial, we will discuss about two frequently used argument keywords '*args' and '**kwargs' . One thing we should keep in mind that we can use any name instead of 'args' and 'kwargs' for these variables. That means you can use any name like '*myargs' , '**mykwargs' etc. Let me show you what are the purpose of these two variables :.

Read