-
Notifications
You must be signed in to change notification settings - Fork 0
/
Suffolk One.py
58 lines (58 loc) · 2.41 KB
/
Suffolk One.py
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
def newchallenge():
print("===============================================================")
newchallenge()
resturant = input("Input your favourite resturant:\n")
food = input("Iput your favourite food:\n")
print("In your opinion, the best resturant is "+str(resturant)+".")
print("As well as this, the best food is "+str(food)+".")
newchallenge()
no_1 = int(input("Enter a number: "))
no_2 = int(input("Enter a second number: "))
op = input("Would you like to add, divide, subtract or multiply the numbers?\n")
if op == "divide":
no_3 = int(no_1/no_2)
print("The division of these numbers is "+str(no_3)+".")
elif op == "add":
no_3 = int(no_1+no_2)
print("The addition of these numbers is "+str(no_3)+".")
elif op == "subtract":
no_3 = int(no_1-no_2)
print("The subtraction of these numbers is "+str(no_3)+".")
elif op == "multiply":
no_3 = int(no_1*no_2)
print("The multiplication of these numbers is "+str(no_3)+".")
else:
print ("You entered an invalid input.")
newchallenge()
name = input("Enter your name:\n")
no_times = int(input("How many times would you like to print it?\n"))
for count in range(no_times):
print(name+" ")
newchallenge()
numberForSquaring = int(input("Enter a number to square and cube:\n"))
Squared = int(numberForSquaring*numberForSquaring)
Cubed = int(numberForSquaring*numberForSquaring*numberForSquaring)
print ("The square of it is "+str(Squared)+" and the cube is "+str(Cubed)+".")
newchallenge()
width = int(input("Input the width of a rectangle in cm:\n"))
length = int(input("Input the length of a rectangle in cm:\n"))
area = width*length
perimeter = ((2*width)+(2*length))
print ("The area is "+str(area)+" and the perimeter is "+str(perimeter)+".")
newchallenge()
distance = int(input("Enter the distance(miles): "))
speed = int(input("Enter the speed(miles per hour): "))
time = int(distance/speed)
print ("It will take "+str(time)+" hours.")
newchallenge()
kg = int(input("Apples cost £1.35 per kg. How many kg do you want to buy? "))
cost = (kg*1.35)
print ("The total cost is £"+str("%.2f" % cost)+".")
newchallenge()
pounds = int(input("Input the number of pounds you want to conver to Euros: "))
euros = (pounds*1.18)
print ("The amount you entered converted to Euros is "+str("%.2f" % euros)+".")
newchallenge()
days = int(input("Enter a number of days to convert to seconds: "))
seconds = (days*86400)
print ("The amount of seconds in your amount of days is "+str(seconds)+".")