HTML Form method Attribute

AmitDiwan
Updated on 27-Sep-2019 11:11:23

263 Views

The HTML form method attribute defines how to send form-data that means to be sent as URL variable or to be sent as an HTTP post transaction.SyntaxFollowing is the syntax −Here get sends the form data as URL variable and post sends the form data as an HTTP post transaction.Let us see an example of HTML Form method Attribute−Example Live Demo    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;    }    input {       width: 315px; ... Read More

HTML Location assign( ) Method

AmitDiwan
Updated on 27-Sep-2019 11:08:20

84 Views

The HTML Location assign() method loads a new HTML document without replacing the URL of the current HTML document from the document history.SyntaxFollowing is the syntax −location.assign(URL)Let us see an example of HTML Location assign() Method−Example Live Demo    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 20px;       width: 330px;       ... Read More

Python Program to Print Numbers in an Interval

Pavitra
Updated on 27-Sep-2019 11:06:50

367 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven the starting and ending range of an interval. We need to print all the numbers in the interval given.A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.There are two for loops, first for loop is for getting the numbers in the interval and second loop for the checking whether the number is prime or not.Now let’s see the implementation.Example Live Demostart = 10 end = 29 for val in range(start, end + ... Read More

How to use the ‘except’ clause with multiple exceptions in Python?

Manogna
Updated on 27-Sep-2019 10:51:43

2K+ Views

It is possible to define multiple exceptions with the same except clause. It means that if the Python interpreter finds a matching exception, then it’ll execute the code written under except clause.In general, the syntax for multiple exceptions is as followsExcept(Exception1, Exception2, …ExceptionN) as e:When we define except clause in this way, we expect the same code to throw different exceptions. Also, we want to take the action in each case.Example codeimport sys try: d = 8 d = d + '5' except(TypeError, SyntaxError)as e: print sys.exc_info()We get output as shown(, TypeError("unsupported operand type(s) for  +: 'int' and 'str'", ), ... Read More

Check if a number N starts with 1 in b-base in C++

Arnab Chakraborty
Updated on 27-Sep-2019 10:49:33

88 Views

We have a number N and a base b. In this program we have to check whether the number is starting with 1 in base b or not. Suppose a number 6 is given. In binary this is 110, so it starts with 1, in base 4 also it will be 124. Here also it starts with 1.As we know, if a number N is represented in base b, b gets converted to m+1 bit sequence bm bm-1 … b0. This implies bm bm + bm-1 * bm-1 + … + b0*b0 = N. The largest number will be 2*bm ... Read More

Is there a standard way of using exception chains in Python 3?

Rajendra Dharmkar
Updated on 27-Sep-2019 10:47:31

214 Views

During the handling of one exception ‘A’, it is possible that another exception ‘B’ may occur. In Python 2.0 versions, if this happens, exception B is propagated outward and exception A is lost. It is useful to know about both exceptions in order to debug the problem.Sometimes it is useful for an exception handler to deliberately re-raise an exception, either to provide extra information or to translate an exception to another type. The __cause__ attribute provides an explicit way to record the direct cause of an exception.Exception chaining is only available in Python 3.  Python 3 has the raise ... ... Read More

Check if a number is Quartan Prime or not in C++

Arnab Chakraborty
Updated on 27-Sep-2019 10:46:17

226 Views

Here we will see another program to check whether a number is Quartan Prime or not. Before dive into the logic, let us see what are the Quartan Prime numbers? The Quartan primes are prime numbers, that can be represented as x4 + y4. The x, y > 0.To detect a number is like that, we have to check whether the number is prime or not, if it is prime, then we will divide the number by 16, and if the remainder is 1, then that is Quartan prime number. Some Quartan prime numbers are {2, 17, 97, …}Example Live Demo#include ... Read More

Check if a number is Palindrome in PL/SQLs

Arnab Chakraborty
Updated on 27-Sep-2019 10:42:03

6K+ Views

In this section we will see how to check whether a number is Palindrome or not using the PL/SQL. In PL/SQL code, some group of commands are arranged within a block of related declaration of statements.A number is palindrome if the number, and the reverse of that number are same. Suppose a number 12321, this is palindrome, but 12345 is not a palindrome.ExampleDECLARE    n number;    m number;    temp number:=0;    rem number; BEGIN    n :=12321;    m :=n;    while n>0    loop       rem := mod(n, 10);       temp := (temp*10)+rem; ... Read More

Check if a number is Full Prime in C++

Arnab Chakraborty
Updated on 27-Sep-2019 10:37:39

218 Views

Here we will see, how to check, whether a number is full prime or not. A number is said to be a full prime, if it is prime, and all of its digits are also prime. Suppose a number is 37, this is full prime. But 97 is not full prime as 9 is not a prime number.One efficient approach is that; first we have to check whether any digit is present that is not prime. Digits must be in 0 to 9. In that range 2, 3, 5 and 7 are prime, others are not prime. If all are ... Read More

Check if a number is a Pythagorean Prime or not in C++

Arnab Chakraborty
Updated on 27-Sep-2019 10:34:40

657 Views

Here we will see another program to check whether a number is Pythagorean Prime or not. Before dive into the logic, let us see what are the Pythagorean Prime numbers? The Pythagorean primes are prime numbers, that can be represented as 4n + 1.To detect a number is like that, we have to check whether the number is prime or not, if it is prime, then we will divide the number by 4, and if the remainder is 1, then that is Pythagorean prime number. Some Pythagorean prime numbers are {5, 13, 17, 29, 37, 41, 53, …}Example Live Demo#include ... Read More

Advertisements