We know docstring gives extra information about the function and classes in Python. We can also use it for testing of the functions using the doctest module. The doctest modules execute the code which starts with >>> and compares it against the expected output.Follow the below steps to write a function with doctest.Import the doctest module.Write the function with docstring. Inside the docstring, write the following two lines for testing of the same function.>>>function_name(*args).Expected output.Write the function code.Now, call the doctest.testmod(name=function_name, verbose=True) function for testing. We can't see the test results if the verbose set to False and all tests ... Read More
In this tutorial, we are going to find the sum of a 2D array using map function in Python.The map function takes two arguments i.e., function and iterable. It passes every element of the iterable to the function and stores the result in map object. We can covert the map object into an iterable.Let's see how to find the sum of the 2D array using the map function.Initialize the 2D array using lists.Pass the function sum and 2D array to the map function.Find the sum of resultant map object and print it.ExampleSee the code below. Live Demo# initializing the 2D array ... Read More
jQuery is a JavaScript library introduced to make development with JavaScript easier. Let us see how to use variable in a string using the html() method.ExampleYou can try to run the following code to learn how to use variable in a string in jQuery −Live Demo $(function(){ $("a").click(function(){ var id= $(".id").html(); $('.myclass').html("Hello"); }); }); Click me Learners
In this tutorial, we are going to create a simple GUI calculator using the Tkinter module. Tkinter is builtin the Python module for developing the GUI application. It's easy to use and comes with Python. We can visualize our data with GUI applications.Let's see how to create a simple GUI calculator.Import everything from the Tkinter using *.Create an interface for the calculator.Create an input function that enters a number into the input field.Create an apparent function that wipes everything from the input field.And finally, evaluate function that computes and gives the result of the expression.Example# importing everyting from tkinter from tkinter import * ... Read More
In SAP, there is a file intro.html that contains detailed instructions on installation of JCo3 on different Operating Systems.Following are the instructions:To install JCo for Windows unzip the appropriate distribution package into an arbitrary directory {sapjco3-install-path}.Note: Do not copy the sapjco3.dll neither into the {windows-dir}\system32 nor into the {windows-dir}\SysWOW64 directory. This will break the operability of other JCo versions that are already installed on the same system. Furthermore you would risk that the current installation also would not work anymore, if the sapjco3.dll gets replaced in the respective Windows system directory in the future.Then add {sapjco3-install-path} to the PATH environment ... Read More
You need to pass browser identification string otherwise Web Dynpro application won’t take browser and will show an error message as mentioned by you.You can refer below link for more details −Apple NSURL Link
In this tutorial, we are going to learn how to create a run-length encoding in Python. Given a string return a new string containing char and frequency.For example, the string tutorialspoint will be encoded as t3u1o2r1i2a1l1s1p1n1. The order is every char+frequency. Join all of them and return. See the steps below to write the program.Write the function with the name run_length_encoding.Initialize a dictionary with OrderedDict to get an initial count of chars as 0.Iterate over every character of the string and increment the count in the dictionary.Join all the chars and their frequencies. And print it.Initialize the strings and invoke ... Read More
In this tutorial, we are going to write a program that checks whether a string contains any special character or not. It's straightforward in Python.We will have a set of special characters in the string module. We can use that one to check whether a string contains any special characters or not. Let's see the steps to write the program.Import the string module.Store the special characters from string.punctuation in a variable.Initialize a string.Check whether the string has special characters or not using the map function.Print the result, whether valid or not.Example# importing the string module import string # special characters ... Read More
Sometimes you want to accept input based on certain conditions. Here, we are going to see the same type of program. We will write a program that allows only words with vowels. We will show them whether the input is valid or not.Let's see the approach step by step.Define a list of vowels [A, E, I, O, U, a, e, i, o, u]Initialize a word or sentence.Iterate over the word or sentence.Check if it is present in the list or not. 3.1.1. If not, break the loop and print Not accepted.Else print acceptedExampleLet's convert the text into Python ... Read More
In this tutorial, we are going to learn how to print the calendar of month and year using the calendar module of Python. It's a straightforward thing in Python. We need year and month numbers. That's it.Let's see how to print a year calendar. Follow the below steps to print the year calendar.Import the calendar module.Initialize the year number.Print the calendar using calendar.calendar(year) class.ExampleSee the below code. Live Demo# importing the calendar module import calendar # initializing the year year = 2020 # printing the calendar print(calendar.calendar(year))OutputIf you run the above code, you will get the following output. ... Read More
 Data Structure
 Networking
 RDBMS
 Operating System
 Java
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP