Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed
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") 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions