- AFloating Decimal
- BText String
- CBoolean Value
- DInteger
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
Python input() function is used to take user input. By default, it returns the user input in form of a text string.
color = input("What color is rose?: ")
print("Rose is", color)
Output
What color is rose?: red Rose is red
In Python, the character # is used to create a single line comment.
Anything following the # on a line is considered a comment and is ignored by the interpreter.
You can also use # to add a comment after a statement on the same line.
In JavaScript, if the result of an arithmetic operation is larger than the largest representable number,
the result will be positive infinity.
Similarly, if the result of an arithmetic operation is smaller than the smallest representable negative number,
the result will be negative infinity.
For example, consider the following code:
let x = 1.7976931348623157e+308;
let y = x * 2;
console.log(y); // prints "Infinity"
let a = -1.7976931348623157e+308;
let b = a * 2;
console.log(b); // prints "-Infinity"
In this example, the variables x and a are assigned the largest and smallest representable numbers, respectively.
When these numbers are multiplied by 2, the result is positive and negative infinity, respectively.
The toFixed() method is a method of the Number object in JavaScript, and it is used to format a number with a specific number of decimal places.
It takes an integer as an argument, which specifies the number of decimal places to include in the formatted number.
For example:
let num = 10.123456;
console.log(num.toFixed()); // Output: "10"
console.log(num.toFixed(2)); // Output: "10.12"
console.log(num.toFixed(5)); // Output: "10.12345"
The toFixed() method rounds the number if necessary,
so the number of digits to the right of the decimal point in the formatted number may be less than the number specified by the argument.