-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex28.py
More file actions
84 lines (80 loc) · 1.95 KB
/
ex28.py
File metadata and controls
84 lines (80 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
================= RESTART: C:\Users\Cecilia\Desktop\ex24.py =================
Let's practice everything.
You'd need to know 'boout escapes with \ that do:
newlines and tabs.
-----------
The lovely world
with logic so firmly planted
cannot discer
the needs of love
nor comprehend passion from intuition
and requires an explanation
where there is none.
-----------
This should be five: 5
With a starting point of: 1000
We'd have 500000 beans, 500.0 jars, and 5.0 crates.
We can also do that this way:
We'd have 50000.0 beans, 50.0 jars, and 0.5 crates.
>>>
================= RESTART: C:/Users/Cecilia/Desktop/ex28.py =================
Traceback (most recent call last):
File "C:/Users/Cecilia/Desktop/ex28.py", line 1, in <module>
true and true
NameError: name 'true' is not defined
>>>
================= RESTART: C:/Users/Cecilia/Desktop/ex28.py =================
>>>
[DEBUG ON]
>>>
[DEBUG OFF]
>>> True and True
True
>>> False and True
False
>>> 1 ==1 and 2==1
False
>>> "test" == "testing"
False
>>> 1 == 1 or 2!1
SyntaxError: invalid syntax
>>> 1 == 1 or 2!=1
True
>>> True and 1==1
True
>>> False and 0!=0
False
>>> True or 1==1
True
>>> "test"== "testing"
False
>>> 1 ! 0 and 2==1
SyntaxError: invalid syntax
>>> 1!=0 and 2==1
False
>>> "test" != "testing"
True
>>> "test" ==1
False
>>> not(True and False)
True
>>> not( 1==1 and 0!= 1)
False
>>> not(10 == 1 or 1000 ==1000)
False
>>> not(1 != 10 0r 3==4)
SyntaxError: invalid syntax
>>> not(1 !=10 or 3==4)
False
>>> not ("testing" == "testing" and "Zed" == "Cool Guy")
True
>>> 1 ==1 and (not("testing" ==1 or 1==0))
True
>>> "chunky" == "bacon" and (not(3 == 4 or 3==3))
False
>>> 3 == 3 and (not("testing" == "testing" or "Python" == "Fun"))
False
>>>