You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Ask for the user's name, if they are called "Bob", print "Welcome Bob!".
5
-
6
-
7
-
5
+
# name = input("What is your name? ")
6
+
# if name == ("Rick") :
7
+
# print("Hello Rick")
8
+
# print("Welcome to class")
9
+
# print( "You are not Rick")
8
10
# 2. Ask for the user's name, if they are not called "Alice", print "You're not Alice!".
9
-
11
+
# name = input("What is your name? ")
12
+
# if name != ("Alice") :
13
+
# print("You are not Alice! ")
14
+
# else :
15
+
# print("You are Alice!")
10
16
11
17
12
18
# 3. Ask the user for a password, if they enter the password "qwerty123", print "You have successfully logged in".
13
19
# If they get it wrong, print "Password failure".
14
-
15
-
20
+
# password = input("Please insert your password ")
21
+
# if password == ("qwerty123") :
22
+
# print("You have successfully logged in ")
23
+
# else :
24
+
# print("Password failure ")
16
25
17
26
# 4. Ask the user to enter a number, if the number is even, print "Even", otherwise print "Odd".
18
-
19
-
27
+
# number = int(input("Please enter a number "))
28
+
# result = number%2
29
+
# if result == 0 :
30
+
# print("The number is even ")
31
+
# else:
32
+
# print("The number is odd ")
20
33
21
34
# 5. Ask the user for 2 different numbers, if the total of the two numbers is over 21, print "Bust" otherwise print "Safe"
22
-
35
+
# number_1 = int(input("Please input number 1 "))
36
+
# number_2 = int(input("Please input number 2 "))
37
+
# blackjack = number_1 + number_2
38
+
# if blackjack > 21 :
39
+
# print("Bust")
40
+
# else :
41
+
# print("Safe")
23
42
24
43
25
44
# 6. Ask the user to enter the length and width of a shape and check if it is a square or not.
45
+
# length = int(input("Please input the length of a shape "))
46
+
# width = int(input("Please input the width of a shape "))
26
47
27
-
48
+
# if length == width :
49
+
# print("The shape is a square ")
50
+
# else:
51
+
# print("The shape is not a square ")
28
52
29
53
# 7. You have had a great year and are going to offer a bonus of 10% to any employee who has a service of over 3 years.
30
54
# Ask the user to input their current salary and years of service and print out their salary and their bonus or "No bonus" if they are not receiving one.
31
-
55
+
# years = int(input("How many years have you been with us? "))
56
+
# salary = float(input("How much is your current salary? "))
57
+
# bonus = 0.1 * salary
58
+
# if years > 3 :
59
+
# print(0.1 * salary)
60
+
# else:
61
+
# print("You are not eligible for bonus ")
32
62
33
63
34
64
# 8. Take a whole number input, if it's positive, print out the number cubed, if it is a negative, print out half its value.
35
-
65
+
# number = int(input("Please input a number "))
66
+
# if number >= 0 :
67
+
# print (number ** 3)
68
+
# else:
69
+
# print(number * 0.5)
70
+
36
71
37
72
38
73
@@ -42,38 +77,87 @@
42
77
# 1. Ask for the user's name, if they are called "Alice" print "Hello, Alice", if they are called "Bob",
43
78
# print "You're not Bob! I'm Bob", else print "You must be Charlie".
44
79
45
-
80
+
# name = input("What is your name? ")
81
+
# if name == ("Alice"):
82
+
# print("Hello Alice! ")
83
+
# elif name == ("Bob") :
84
+
# print("Hello Bob! ")
85
+
# else:
86
+
# print("You must be Charlie ")
46
87
47
88
# 2. Ask the user to enter their age:
48
89
# 1. If they are younger than 11, print "You're too young to go to this school"
49
90
# 2. If they are between 11 and 16, print "You can can come to this school"
50
91
# 3. If they are over 16, print 'You're too old for school"
51
92
# 4. If they are 0, print "You're not born yet!"
52
-
53
-
93
+
# age = int(input("How old are you? "))
94
+
# if age == 0:
95
+
# print("You're not born yet ")
96
+
# elif age < 11:
97
+
# print("You're too young to go to this school ")
98
+
# elif age >= 11 and age <= 16 :
99
+
# print("You can come to this school ")
100
+
# elif age > 16:
101
+
# print("You are too old for school ")
54
102
55
103
# 3. Ask the user to enter the name of a month. If the user enters March/April/May: print "<month> is in Spring", otherwise print "I don't know".
56
104
# 1. Expand for the rest of the year, given that summer is June/July/August. Autumn is September/October/November. Winter is December/January/February.
57
105
# 2. Ensure that when an unknown month is given it prints "I don't know".
58
-
106
+
# month = input(("What month are we in? "))
107
+
# if month == ("March") or month == ("April") or month == ("May"):
108
+
# print( month + (" is in Spring "))
109
+
# if month == ("June") or month == ("July") or month == ("August"):
110
+
# print( month + (" is in Summer "))
111
+
# elif month == ("September") or month == ("October") or month == ("November"):
112
+
# print( month + (" is in Autumn "))
113
+
# elif month == ("December") or month == ("January") or month == ("February"):
114
+
# print( month + (" is in Winter "))
115
+
# else:
116
+
# print(" I dont know ")
59
117
60
118
61
119
# 4. Ask the user for two different numbers, if both numbers are even, print "Even", if both numbers are odd, print "Odd", else print the product of the two numbers.
120
+
# num1 = int(input("Please input a number: "))
121
+
# num2 = int(input("Please input another number: "))
122
+
# if num1%2 == 0 and num2%2 == 0:
123
+
# print("Even")
8000
124
+
# elif num1%2 > 0 and num2%2 > 0:
125
+
# print("Odd")
126
+
# else :
127
+
# print(num1 * num2)
62
128
63
129
64
130
65
131
# 5. Ask the user to input two numbers. Decide which is the number of highest value and print this out.
66
-
132
+
# num1 = int(input("Please input a number: "))
133
+
# num2 = int(input("Please input another number: "))
134
+
# if num1 > num2 :
135
+
# print("The hightest number is " + str(num1))
136
+
# else:
137
+
# print("The hightest number is " + str(num2))
67
138
68
139
69
140
# 6. You have had a fantastic year and are now going to offer a bonus of 20% to any employee who has a service of over 7 years,
70
141
# a bonus of 15% to any employee who has a service of over 5 years and a bonus of 10% to any employee who has a service of 3 - 5 years.
71
142
# Ask the user to input their current salary and years of service and print out their salary and their bonus or "No bonus" if they are not receiving one.
143
+
# salary = float(input("How much do you earn? "))
144
+
# service = int(input("How long have you been with us? "))
145
+
# if service >= 3 and service <= 5:
146
+
# print("Your salary is " + str(salary)+ " and your bonus is " + str(0.1 * salary))
147
+
# elif service > 5 and service <7:
148
+
# print("Your salary is " + str(salary)+ " and your bonus is " + str(0.15 * salary))
149
+
# elif service >= 7:
150
+
# print("Your salary is " + str(salary) + " and your bonus is " + str(0.2 * salary))
151
+
# else:
152
+
# print ("Since your years of service is less than three, you are ineligible for bonus this year")
72
153
73
154
74
155
75
156
# 7. Take the age and name of three people and determine who is the oldest and youngest and print out the name and age of the oldest and youngest.
76
157
# If all three ages are the same, print that.
158
+
sum=5+6
159
+
ifsum==10:
160
+
print("the value is 10")
77
161
78
162
79
163
@@ -85,3 +169,45 @@
85
169
# e. 25 to 45 – E
86
170
# f. Below 25 - F
87
171
# Ask user to enter the lesson and the marks for three lessons and print out the corresponding grades for the lesson.
0 commit comments