Question: Python3 7. Given the following assignment: x = 2, Indicate what each of the following Python statements would print. print(x) print(x) print(x) print(x + 1)
7. Given the following assignment: x = 2, Indicate what each of the following Python statements would print. print("x") print(x) print(x) print("x + 1") print("x + 1) print(x + 1) 8. Given the following assignments: 11=2, 12-5, 13=-3, d1=2.0, and d2-5.0 Evaluate each of the following Python expressions. a) 12/11 b) 12//i1 c) d2/d1 d) i1/d2 e) 11/12ed1 d111/12 B) d1+d2 +d2/3 h) 3 * 11 //12. d1-d2 9. Sort the following binary operators in order of high to low precedence: +,-./1.1,%,= 10. Try some of following activities within a Python program: a) print a variable that has not been assigned b) convert the string 'two' to an integer c) add an integer to a string d) assign to a variable named end-point e) compute raise a floating-point number to a large power, as in 1.500.000 f) compute x=5/(3-2-1) What circumstances can cause each of the following run-time errors to arise? a) NameError b) ValueError c) ZeroDivisionError d) OverflowError e) SyntaxError f) TypeError CamScanner
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
