-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lecture "Programming languages", exercise 2 #12
Comments
True. |
I think the solution is
|
The value is
So, |
|
The answer is:
|
The value is |
"spam" not in "spa span sparql" and not ("egg" > "span") "spam" not in "spa span sparql" and not (False) |
"spam" not in "spa span sparql" = True Note, python uses unicode to compare strings and compares them character by character. Here, the unicode value of 'e from egg' is smaller than 's from span' as e comes before in the alphabets and in the unicode. It gives us the the result false which gets converted to true with the help of not operation. now the final equation looks like : True and True = True. Thus the final output will be True or 1 |
1)not 2)and 3)or "spam" not in "spa span sparql" and not ("egg" > "span") |
the Boolean value is True "spam" not in "spa span sparql" and not False = True |
The boolean value of "spam" not in "spa span sparql" and not ("egg" > "span") is True. |
The boolean value is True |
|
|
{"spam" not in "spa span sparql"} and {not ("egg" > "span")} We have {True} and {not(False)} = {True} and {True} = {TRUE} |
"spam" not in "spa span sparql" and not ("egg" > "span") |
"Spam" not in "spa span sparql" and not ("egg" > "span" ) -> |
|
|
"spam" not in "spa span sparql" =
|
What is the boolean value of
"spam" not in "spa span sparql" and not ("egg" > "span")
?The text was updated successfully, but these errors were encountered: