Merge pull request 'Merge Week 1' (#1) from week-1 into master
Reviewed-on: https://kitsunehosting.net/gitea/Kenwood/SNHU-IT-140/pulls/1 This is fine to get merged now :3
This commit is contained in:
commit
411c58ac5d
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
*.pyc
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,9 @@
|
||||||
|
if __name__ == '__main__':
|
||||||
|
num1 = int(input('Enter integer:\n'))
|
||||||
|
|
||||||
|
print('You entered: {0}'.format(num1))
|
||||||
|
print('{0} squared is {1}'.format(num1, num1 ** 2))
|
||||||
|
print('And {0} cubed is {1} !!'.format(num1, num1 ** 3))
|
||||||
|
num2 = int(input('Enter another integer:\n'))
|
||||||
|
print('{0} + {1} is {2}'.format(num1, num2, num1 + num2))
|
||||||
|
print('{0} * {1} is {2}'.format(num1, num2, num1 * num2))
|
|
@ -0,0 +1,13 @@
|
||||||
|
if __name__ == '__main__':
|
||||||
|
user_num = int(input())
|
||||||
|
x = int(input())
|
||||||
|
|
||||||
|
result = []
|
||||||
|
|
||||||
|
for i in range(3):
|
||||||
|
if i == 0:
|
||||||
|
result.append(int(user_num / x))
|
||||||
|
else:
|
||||||
|
result.append(int(result[i - 1] / x))
|
||||||
|
|
||||||
|
print(*result)
|
|
@ -0,0 +1,11 @@
|
||||||
|
''' Women: Calories = ((Age x 0.074) - (Weight x 0.05741) + (Heart Rate x 0.4472) - 20.4022) x Time / 4.184 '''
|
||||||
|
''' Men: Calories = ((Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) - 55.0969) x Time / 4.184 '''
|
||||||
|
|
||||||
|
''' Type your code here. '''
|
||||||
|
|
||||||
|
age = float(input())
|
||||||
|
weight = float(input())
|
||||||
|
bpm = float(input())
|
||||||
|
time = float(input())
|
||||||
|
|
||||||
|
print('Women: {0:.2f} calories\nMen: {1:.2f} calories'.format(((age * 0.074) - (weight * 0.05741) + (bpm * 0.4472) - 20.4022) * time / 4.184, ((age * 0.2017) + (weight * 0.09036) + (bpm * 0.6309) - 55.0969) * time / 4.184))
|
|
@ -2,8 +2,12 @@
|
||||||
# Construct a mad lib
|
# Construct a mad lib
|
||||||
class mad_lib:
|
class mad_lib:
|
||||||
|
|
||||||
|
# Initalize a constructor for python mad lib
|
||||||
def __init__(self, lib):
|
def __init__(self, lib):
|
||||||
|
# lib is a value passed in during the construction of this class
|
||||||
self.text = lib
|
self.text = lib
|
||||||
|
|
||||||
|
# Replace %text% with user input
|
||||||
self.text = self.text.replace('%first_name%', self.first_name())
|
self.text = self.text.replace('%first_name%', self.first_name())
|
||||||
self.text = self.text.replace('%location%', self.location())
|
self.text = self.text.replace('%location%', self.location())
|
||||||
self.text = self.text.replace('%whole_number%', self.whole_number())
|
self.text = self.text.replace('%whole_number%', self.whole_number())
|
Loading…
Reference in New Issue