Replace Number with String Using Python

Malhar Lathkar
Updated on 20-Jun-2020 09:05:51

2K+ Views

For this purpose let us use a dictionary object having digit as key and its word representation as value −dct={'0':'zero', '1':'one', '2':'two', '3':'three', '4':'four',      '5':'five', '6':'six', '7':'seven', '8':'eight', '9':'nine'Initializa a new string object newstr=''Using a for loop traverse each character  ch from input string at check if it is a digit with the help of isdigit() function. If it is digit, use it as key and find corresponding value from dictionary and append it to newstr. If not append the character ch itself to newstr. Complete code is as follows:string='I have 3 Networking books, 0 Database books, and 8 Programming ... Read More

MySQL FIELD and ELT Functions: A Complementary Overview

Jai Janardhan
Updated on 20-Jun-2020 09:04:45

179 Views

On the basis of the working of both the functions, we can say that both are the complement of each other. Actually, as we know that FIELD() function, on providing a string as an argument, returns the index number of the string from string list and ELT() function, on providing index number as an argument, returns the string from string list. In the following example, we have applied both the functions on the same string, it would demonstrate the concept −Examplemysql> SELECT ELT(4, 'Ram', 'is', 'good', 'boy')As Result; +--------+ | Result | +--------+ | boy    | +--------+ ... Read More

Output of MySQL EXPORT_SET Function When Skipping Arguments

Akshaya Akki
Updated on 20-Jun-2020 09:00:18

115 Views

As we know that the default value of the fifth argument i.e. number of bits is 64, hence if we will not specify any value on fifth argument them MySQL will check the bits up to 64 bits and produce the result. Whereas, on skipping the fourth argument i.e. separator, MySQL will use a comma (, ) as a separator while displaying the output.Examplemysql> SELECT EXPORT_SET(8, 'Y', 'N')\G *************************** 1. row *************************** EXPORT_SET(8, 'Y', 'N'): N, N, N, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, ... Read More

Scale Transform the Element by Using Y-Axis with CSS3

Srinivas Gorla
Updated on 20-Jun-2020 08:56:54

347 Views

The scaleY(y) method is used to scale transform the element using y-axis.Let us see the syntax −scaleY(y)Here, y is a number representing the scaling factor to apply on the ordinate of each point of the element.Let us see an example −div {    width: 60px;    height: 60px;    background-color: yellow; } .scaled {    transform: scaleY(0.5);    background-color: black; }

Output of MySQL ELT Function with Non-Integer Index

Alankritha Ammu
Updated on 20-Jun-2020 08:56:38

135 Views

As we know the 1st argument of ELT() function must be an integer value but when we provide index number which is not an integer the MySQL ELT() function returns NULL with a warning.Examplemysql> select ELT('one','Ram,is,good,boy')As Result; +--------+ | Result | +--------+ | NULL   | +--------+ 1 row in set, 1 warning (0.00 sec) mysql> Show Warnings; +---------+------+------------------------------------------+ | Level   | Code | Message                                  | +---------+------+------------------------------------------+ | Warning | 1292 | Truncated incorrect INTEGER value: 'one' | +---------+------+------------------------------------------+ 1 row in set (0.00 sec)

Scale Transform Element using X-Axis with CSS3

radhakrishna
Updated on 20-Jun-2020 08:55:28

224 Views

The scaleX(x) method is used to scale transform the element using x-axis.Let us see the syntax −scaleX(x)Here, x is a number representing the scaling factor to apply on the abscissa of each point of the element.Let us see an example −div {    width: 60px;    height: 60px;    background-color: yellow; } .scaled {    transform: scaleX(0.5);    background-color: black; }

Block of PL/SQL in Oracle DBMS

Ricky Barnes
Updated on 20-Jun-2020 08:55:16

4K+ Views

PL/SQL is a block structured language i.e the code of PL./SQL is written in the form of blocks. PL/SQL also contains the robustness, security and portability of the Oracle database.Each block of PL/SQL contains the following subparts −Declarations -  This section contains all the items that needs to be declared before the program such as variables, subprograms etc. This section contains the keyword DECLARE at its start. In general, Declarations is an optional subpart of the PL/SQL program.Executable Commands -  This section of the PL/SQL code contains the executable statements. It contains BEGIN and END at its starting and ending. ... Read More

Cursors in Oracle DBMS

Amit Diwan
Updated on 20-Jun-2020 08:53:39

4K+ Views

When a SQL statement is executed in Oracle, the temporary context area is created. This area contains all the relevant information relating to the statement and its execution. The cursor is a pointer to this context area and allows the PL/SQL program to control this area.There are two types of Cursors.Implicit CursorsExplicit CursorsLet us begin with Implicit Cursors −Implicit CursorsWhenever an SQL statement is executed, the implicit cursors are automatically created. This happens if there is no explicit cursor for the particular statement. Implicit cursors cannot be controlled by the programmers.There are many different attributes for Implicit Cursors. Some of ... Read More

CSS3 Font Combinations

varun
Updated on 20-Jun-2020 08:50:06

134 Views

CSS3 has adapted font combinations technology. In here, if the browser does not support the first font then it tries the next font.Let us see an example of Sans-Serif fonts −

FIELD Function vs FIND_IN_SET Function in MySQL

Arjun Thakur
Updated on 20-Jun-2020 08:49:28

1K+ Views

As we know, both the functions are used to search a string from the arguments provided in them but there are some significant differences between them as follows −FIND_IN_SET() −  function uses the string list that is itself a string containing the substring separated by commas. Whereas, FIELD() function contains list of different strings among which it will find the index number of the string, if present, which is to be searched.FIND_IN_SET() −  function returns NULL if any of the argument i.e. either search string or string list is NULL. In contrast, FIELD() function do not returns NULL but returns ... Read More

Advertisements