-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythonchallengeflow.py
More file actions
87 lines (60 loc) · 1.65 KB
/
Copy pathpythonchallengeflow.py
File metadata and controls
87 lines (60 loc) · 1.65 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
num1 = 6
num2 = 3
# Write your if statement here
if num1 + num2 != 10:
not_ten = True
else:
not_ten = False
# Uncomment the below lines to show the result
print("Is the sum of the numbers not equal to 10? " + str(not_ten))
# Monthly budget
budget = 2000
# Monthly expenses
food_bill = 200
electricity_bill = 100
internet_bill = 60
rent = 1500
# Calculate the total amount of expenses
total = food_bill + electricity_bill + internet_bill + rent
# Check if the total is greater than the budget and store the result in over_budget
if total >= budget:
over_budget = True
else:
over_budget = False
# Uncomment the below lines to see the results
print("Total: " + str(total))
print("Is it over budget? " + str(over_budget))
# Write your large_power function here:
def large_power(base, exponent):
if base**exponent > 5000:
return True
else:
return False
# Uncomment these function calls to test your large_power function:
print(large_power(2, 13))
# should print True
print(large_power(2, 12))
# should print False
# Write your twice_as_large function here:
def twice_as_large(num1, num2):
num2 = num2*2
if num1 > num2:
return True
else:
return False
# Uncomment these function calls to test your twice_as_large function:
print(twice_as_large(10, 5))
# should print False
print(twice_as_large(11, 5))
# should print True
# Write your divisible_by_ten() function here:
def divisible_by_ten(num):
if num % 10 == 0:
return True
else:
return False
# Uncomment these print() function calls to test your divisible_by_ten() function:
print(divisible_by_ten(20))
# should print True
print(divisible_by_ten(25))
# should print False