Posts

Showing posts with the label python

Application Development using Python (18CS55) VTU Questions and Solutions - 2

 1.   Explain in and not operator in string with suitable examples. Ans : in and not in are membership operators. in operator. The in operator in Python checks whether a specified value is a constituent element of a sequence like string, array, list, or tuple etc. When used in a condition, the statement returns a Boolean result evaluating into either True or False. When the specified value is found inside the sequence, the statement returns True. Whereas when it is not found, we get a False. The ‘not in’ operator is the complement of in. [02] a in  calendar                    z in calendar       a not in calendar       z not in calendar True                                 False                   False          ...

Application Development using Python (18CS55) VTU Questions and Solutions - 1

Image
  1. Demonstrate the operator precedence & associative rule with respect to arithmetic operations with examples.  5 M Operator Operation Example Evaluates to Associative rule ** Exponent 2 ** 3 8 right-to-left % Modulus/remainder 22 % 8 6 Left to right // Integer division/floored quotient 22 // 8 2 Left to right / Division 22 / 8 2.75 Left to right * Multiplication 3 * 5 15 Left to right - Subtraction 5 - 2 3 Left to right + Addition 2 + 2 4 Left to right 2.  Implement a Number Guessing Game by ensuring the following criteria     • The guess number is generated by the ...