Docsity

Unit 2: CS Python: Project Stem Answer Key Actual Updated Questions And Answers, Exams of Medicine

Toggle sidebar
bg1
Unit 2: CS Python: Project Stem Answer Key Actual Updated Questions
And Answers
1.
2.1 Lesson Prac-
tice
2.
2.2 Lesson Prac-
tice
Question 1:
Charles Babbage
Question 2:
Mauchly and Eckert
Question 3:
Alan Turing
Question 4:
Konrad Zuse
Question 5:
1948
Question 1:
print("Difference is: " + str(x - y))
Question 2:
//
Question 3:
6
Question 4:
"Ada" = x
Question 5:
a = 5**3
Question 6:
Variables
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Unit 2: CS Python: Project Stem Answer Key Actual Updated Questions And Answers and more Exams Medicine in PDF only on Docsity!

Unit 2: CS Python: Project Stem Answer Key Actual Updated Questions And Answers

  1. 2.1 Lesson Prac- tice
  2. 2.2 Lesson Prac- tice Question 1: Charles Babbage Question 2: Mauchly and Eckert Question 3: Alan Turing Question 4: Konrad Zuse Question 5: 1948 Question 1: print("Difference is: " + str(x - y)) Question 2: // Question 3: 6 Question 4: "Ada" = x Question 5: a = 5** Question 6: Variables

Question 7:

  1. 2.3 Code Practice (Questions 1 - 2)
  2. 2.4 Lesson Prac- tice
  3. 2.4 Code Practice (Questions 1 - 2) Question 5: I have completed the questions in the link. Question 1: x = float(input("Input the dividend: ")) y = float(input("Input the divisor: ")) print("The quotient + the remainder is " + str((x // y) + (x % y))) Question 2: w = int(input("Enter the Yards: ")) x = int(input("Enter the Feet: ")) y = int(input("Enter the Yards: ")) z = int(input("Enter the Feet: ")) print("Yards: " + str((w + y) + ((x + z) // 3)) + " Feet: " + str((x + z) % 3)) Question 1: import math Question 2: fabs() Question 3: sqrt() Question 4: pow() Question 1: import math x = int(input("Enter a number: ")) y = math.fabs(x) z = math.sqrt(y) print("The final outcome is: " + str(z))
  1. 2.5 Lesson Prac- tice Question 2: import math x = float(input("Enter a number: ")) z = math.fabs(x) f = math.floor(z) y = z - f print("The final outcome is: " + str(round(y, 3))) *Note (I understand you don't use the math.floor command in this unit but I got my dad to help me) Question 1: They do not generate truly random numbers. Question 2: 1, 2, 3, 4, 5 Question 3: 1.0 <= r < 2.
  2. 2.5 Code Practice Question 1: import random a = random.randint(1, 5) b = random.randint(1, 5) answer = a * b print (str(a) + " * " + str(b) + " = " + str(answer))
  3. Quiz 2 Question 1: Assignment Question 2: 2 Question 3:
  1. Assignment 2: Room Area north = max(lat) west = min(lon) south = min(lat) east = max(lon) print("Farthest north is " + str(north)) print("Farthest west is " + str(west)) print("Farthest south is " + str(south)) print("Farthest east is " + str(east)) Assignment: sidea = int(input("Enter side A: ")) sideb = int(input("Enter side B: ")) sidec = int(input("Enter side C: ")) sided = int(input("Enter side D: ")) sidee = int(input("Enter side E: ")) answer = (sideb * sidec) + ((sidea - sidec) * (sided - sidee)) + (1/2 * (sidee * (sidea
    • sidec))) print("Room Area: " + str(answer))
  2. Test 2 Question 1: print(y - int(y)) Question 2: To store a decimal number such as 3. Question 3: This would cause an error: a string cannot be typecast to an integer Question 4: decimal Question 5: 5

Question 6: string() Question 7: random.randint(-5, 5) Question 8: 8 Question 9: 1 Question 10: 1 Question 11: sqrt() Question 12: fabs() Question 13: 28 Question 14: The code is missing parentheses around a + b + c in the last line. Question 15: None, there is an error. Question 16: 2 * (6 - 2 / 2)