Compare commits
No commits in common. "411c58ac5d215ee281ca663b443b6c8b4cb5e5df" and "224966a158df5a937086514c2404cef6d993084c" have entirely different histories.
411c58ac5d
...
224966a158
|
@ -1,2 +0,0 @@
|
||||||
|
|
||||||
*.pyc
|
|
|
@ -2,12 +2,8 @@
|
||||||
# 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())
|
||||||
|
@ -34,4 +30,4 @@ class mad_lib:
|
||||||
# Construct a mad lib
|
# Construct a mad lib
|
||||||
md = mad_lib('%first_name% went to %location% to buy %whole_number% different types of %plural_noun%')
|
md = mad_lib('%first_name% went to %location% to buy %whole_number% different types of %plural_noun%')
|
||||||
|
|
||||||
print(md.text)
|
print(md.text)
|
Binary file not shown.
Binary file not shown.
|
@ -1,9 +0,0 @@
|
||||||
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))
|
|
|
@ -1,13 +0,0 @@
|
||||||
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)
|
|
|
@ -1,11 +0,0 @@
|
||||||
''' 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))
|
|
Loading…
Reference in New Issue