In Python, afunction ord()is used to convert the characters into a numerical value. This is an inbuilt function. Let's see the program, # input a numbers=input('Enter the character: ')# getting its ascii valuen=str(ord(s))# printing the resultprint('ASCII of character {} is {}.'...
Python supports a variety of inbuilt modules and functions to perform different tasks. The regex module is one of them that provides several functions to perform various kinds of tasks, such as the replacement of strings, finding strings, etc. The “re” (acronym of regex) module provides a ...
Functions are called modules in Micropython. Then import sleep class from utime module for delay. Create an led object which takes 2 parameters.First is the GPIO PIN , which is 25 where the inbuilt led is connected. Second parameter to declare this pin as OUTPUT. Then starts the never endi...
There are functions in File that allows the users to open files, read the entire File, read one line at a time, write a string to a file and close the file. Data structures Algorithms in Python Algorithms are a basic guideline for solving a problem in a programming language. Below...
In myprevious postwe discussed how to write a very simple Java client to read/write data from/to a MongoDB database. In this post, we are going to see how to use inbuilt Map-Reduce functionality in MonogoDB to perform a word counting task. If you are new to Map-Reduce, please go ...