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:
Kenwood 2021-01-08 21:14:33 -05:00
commit 411c58ac5d
13 changed files with 40 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.pyc

View File

@ -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))

View File

@ -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)

View File

@ -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))

View File

@ -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())

0
readme.md Normal file
View File

View File

@ -1,6 +0,0 @@
a = 3
x = 4
y = a * x
y = y + 7
print (x, y)