True/False Questions Question 1Ī set can contain duplicate values in it.Ī Boolean value is internally treated as an integer value. To use mean() function, statistics module is to be imported. To generate a random number in a sequence of values where two values have a difference a step value, randrange() or random.randrange() function is used. To generate a random integer in a range, randint() or random.randint() function is used. To generate a random floating number in the range 0 to 100, random() or random.random() function is used. To use function fabs( ), math module should be imported. To check if two objects reference the same memory address, is operator is used. The id of an object gives the memory location of the object. The tuple datatype is like lists but is not mutable. The set sequence type cannot store duplicate values. The division of two integers yields a result of floating-point type. The floor division of two integers yields a result of integer type. Three mutable types of Python are lists, dictionaries and sets. Python's floating point numbers have precision of 15 digits. Two forms of floating-point numbers are: fractional form and exponent notation. What will be the result of the expression 'false' or False ?īoolean data type is internally treated as integer data type. What will be the result of the expression 'false' and False ? What will be the result of the expression 'None' and 'a' ? What will be the result of the expression 'a' and 'None' ? ![]() What will be the result of the expression 'a' and 'x' ? What will be the result of the expression 'x' and 'a' ? What will be the result of the expression 'a' and " (" is an empty string) ? What will be the result of the expression 'a' or " (" is an empty string) ? What will be the result of the expression 15 and 10? What will be the result of the expression 5 and 10? What will be the result of the expression 5 or 10 ? What will be the result of the expression 10 or 0 ? To increase the value of x five times using an augmented assignment operator, the correct expression will be What is the value of the expression 10 + 3 ** 3 * 2? Which of the following operators has the lowest precedence ? Import math x = 100 print ( x > 0 and math. Is it safe to directly use the = operator to determine whether objects of type float are equal ? In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type. In Python, a variable is assigned a value of one type, and then later assigned a value of a different type. ![]() In Python, a variable must be declared before it is assigned a value. What is the value of the expression 100 // 25 ? What is the value of the expression 100 / 25 ? Python operator always yields the result of. Which of the following is not an immutable type in Python ? operator.įor two objects x and y, the expression x is y will yield True, if and only if ![]() The operator used to check if both the operands reference the same object memory, is the. Which Python built-in function returns the unique number assigned to an object? Which of the following are datatypes considered as Numbers in Python.Ĭonsider the following sequence of statements:įollowing the execution of these statements, Python has created how many objects and how many references ? In other words we can say that ” Dictionaries are mutable, unordered collection of elements in the form of Key-Value Pairs which are enclosed in curly braces“.Which of the following are valid Python data types ? All the Key-Value pairs are enclosed in Curly braces. Each value/values is associated with a unique key. Python Dictionary What is Python Dictionary?Ī python dictionary is a collection of elements where each element is a combination of Key-Value pair.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |