comp-think / 2023-2024

The GitHub repository containing all the material related to the Computational Thinking and Programming course of the Digital Humanities and Digital Knowledge degree at the University of Bologna (a.a. 2023/2024).
14 stars 0 forks source link

Lecture "Programming languages", exercise 2 #11

Open essepuntato opened 8 months ago

essepuntato commented 8 months ago

What is the boolean value of "spam" not in "spa span sparql" and not ("egg" > "span")?

vattelalberto commented 8 months ago

False

qwindici commented 8 months ago
FranciscoWu commented 8 months ago

since spam is not in "spa span sparql", it's a True since egg < span, it's a False so it'll be: True and True, it's a "True"

valetedd commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span")

lucreziapograri commented 8 months ago

null (8) The boolean value of "spam" not in "spa span sparql" and not ("egg" > "span") is True.

frammenti commented 8 months ago
"spam" not in "spa span sparql" and not ("egg" > "span")
True and not False
True and True
True
Liber-R commented 8 months ago

True

alicepiazzi commented 8 months ago
Schermata 2023-10-21 alle 13 37 57
Chiaramartina commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") "spam" not in "spa span sparql" = True ("egg" > "span") = False True and not False True and True True

rufferbaraldi commented 8 months ago

true and true

True

matildepassafaro commented 8 months ago

"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" and True True and True True

annapasetto0 commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") "spam" not in "spa span sparql" and not False "spam" not in "spa span spargl" and True True and True True

saramadonia commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") True and not ("egg" > "span") True and not(False) #I have compared the strings' lexicographical order True and True True

ThIheb commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span")

  1. "spam" is not in "spa span sparql" so "spam" not in "spa span sparql" returns True
  2. ("egg > "span") returns False (according to the order of the letters within the string)

So we have True and not (False) True and True True

The final result is True

valentinabertelli commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") "spam" not in "spa span sparql" and not False True and True True

AnnaNicoletti commented 8 months ago

image

MariaFrancesca6 commented 8 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") "spam" not in "spa span sparql" = True and not False True and True True

enricabruno commented 8 months ago
Screenshot 2023-10-22 alle 23 45 33
elena2notti commented 8 months ago

True

simocasaz commented 8 months ago

IMG_20231025_193642.jpg

parkful commented 8 months ago

"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" and True True and True True

CarlaMenegat commented 7 months ago

"spam" not in "spa span sparql" and not ("egg" > "span") True and True True