-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5 if.py
More file actions
68 lines (54 loc) · 1.7 KB
/
5 if.py
File metadata and controls
68 lines (54 loc) · 1.7 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
# what can I use in an if or while
# > >= < <= == != in and or # a == b
a = 1000
b = 1000
if a != b :
print ( 'hello world')
print ( 'a is not equal ')
print ( 'a is not equal ')
print ( 'a is not equal ')
print ( 'this will print after the if has ended' )
if a >= b :
print ( 'a is bigger or equals')
else :
print ( 'a is not bigger ')
print ( 'this will print after the if has ended' )
#
###
if a > b :
print ( 'a is bigger ')
elif a == b :
print ( 'a and b are equal')
else :
print ( 'a is smaller ')
###
a = 2021
if a in ( 2020, 2019, 2018 ):
print ( "a IS in value set")
else:
print ( "a IS NOT in value set")
##
if a == 2020 or a == 2019 or a == 2018:
print ( "a in value set")
#
if a not in ( 2020, 2019, 2018 ):
print ( "a NOT in value set")
else:
print ("is in the set")
#
## HOMEWORK =============================================================================
## The movie house does not allow parties of > 10 .
## If the total number of tickets is more than 10,
# # Print an appropriate message
# Calculate children on if there is any adult
# If there are no adults but > 0 children, then print a message and totalticketprince is 0
## Otherwise:
# Display :
# The ticket price for
# ___ adults ,
# ___ pensioners
# if (adults > 0 or pensioners > 0 ) and children > 0
# ___ children
# will be ___
# Suppress information about adults , children or pensioners if any grouping is not buying tickets
# =============================================================================