Write logical expression for the following in python script: a) Place is either 'Delhi' or 'Goa' but not 'Jaipur' b) name is Aman and age is between 18 to 35
Answers
Answer:
The answer to the given question is:
a) (place is 'Delhi' or 'Goa') and place is not 'Jaipur'
b) name is 'Aman' and (age >= 18 and age <= 35)
Explanation:
Expressions represent values, whereas statements differ from statements in that they do something. For example, a string also represents the value of the string, so any string is an expression.
Python has some advanced structures that you can use to represent values, so these structures are also called expressions.
Python expressions contain only identifiers, literals, and operators.
Identifier: All names used to define a class, function, variable module, or object are identifiers. Literals: These are Python language-independent terms and must exist independently of each programming language. Python has string literals, byte literals, integer literals, floating point literals, and imaginary literals. Operators: In Python, you can use the appropriate tokens to implement the following operations:
#SPJ3