-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomework.python
More file actions
24 lines (19 loc) · 936 Bytes
/
Homework.python
File metadata and controls
24 lines (19 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
import math;
first = "Mike";
last = "Polinske";
age = 43;
print first + " " + last + " " + str(age);
sideA = 12.55;
sideB = 17.85;
sideC = math.sqrt((sideA * sideA) + (sideB * sideB));
print sideC;
operand1 = 95;
operand2 = 64.5;
print (str(operand1) + " + " + str(operand2) + " = " + str(operand1 + operand2));
print (str(operand1) + " - " + str(operand2) + " = " + str(operand1 - operand2));
print (str(operand1) + " * " + str(operand2) + " = " + str(operand1 * operand2));
print (str(operand1) + " / " + str(operand2) + " = " + str(operand1 / operand2));
print (str(operand1) + " % " + str(operand2) + " = " + str(operand1 % operand2));
# The print statements above work the best since you can not concatenate strings and numerics together, you have to convert the numerics to strings.
# If the operands were to change between integers, longs or floats no changes in the print statements should be necessary.