-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab_Act_Conditional.py
More file actions
100 lines (72 loc) · 1.87 KB
/
Copy pathLab_Act_Conditional.py
File metadata and controls
100 lines (72 loc) · 1.87 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#Script 1
"""
x = 2
print (x == 2)
print (x == 3)
print (x < 3)
print ("\n")
#Script 2
name = "John"
age = 23
if name == "John" and age == 23:
print("Your name is John, and you are also 23 years old.")
if name == "John" or name == "Rick":
print("Your name is either John or Rick.\n")
name = "Rick"
age = 23
if name == "John" and age == 23:
print("Your name is John, and you are also 23 years old.")
if name == "John" or name == "Rick":
print("Your name is either John or Rick.\n")
#Script 3:
name = "John"
if name in ["John", "Rick"]:
print("Your name is either John or Rick.\n")
#Script 4:
x = 2
y = 2
print(x == y)
print(x is y,"\n")
#Script 5:
print(not False)
print((not False) == (False),"\n")
#Script 6:
# change this code
number = 16
second_number = 0
first_array = [1,2,3]
second_array = [1,2]
# do not change here
if number > 15:
print("1")
if first_array:
print("2")
if len(second_array) == 2:
print("3")
if len(first_array) + len(second_array) == 5:
print("4")
if first_array and first_array[0] == 1:
print("5")
print("\n\n")
#Script 7:
print("Display the highest no. between the 3 inputs")
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("enter the third numbre: "))
if (num1 >= num2) and (num1 >= num3):
largest = num1
elif (num2 >= num1) and (num2 >= num3):
largest = num2
else:
largest = num3
print ("The largest number is:" ,(largest))"""
#Script 8:
answer = (input("Are you sure you want to quit?(y/n): "))
if answer == 'Y':
print ("Hope to see you again!!!")
elif answer == 'y':
print ("Hope to see you again!!!")
elif answer == 'N':
print ("Welcome back!!")
elif answer == 'n':
print ("Welcome back!!")