Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
100%

Look over Python assignment and answer one question. 

Hi, I have attached both the assignment directions and a copy of my work so far. I wanted to make sure I was properly explaining the results. I also don't understand why the last print statement, print(2//3) has a result of zero instead of 8. Thanks so much. 

Launch Python IDLE (an interactive Python session) and execute the following statements. Capture the
results in the Word document. Explain the results.
а.
print("Hello", "World!")
b.
print(3.0)
print(2.0 + 3.0)
С.
d.
print("2" + "3")
е.
print("2 + 3 =", 2 + 3)
f.
print(2 ** 3)
g.
print(2/3)
h.
print(2 // 3)
expand button
Transcribed Image Text:Launch Python IDLE (an interactive Python session) and execute the following statements. Capture the results in the Word document. Explain the results. а. print("Hello", "World!") b. print(3.0) print(2.0 + 3.0) С. d. print("2" + "3") е. print("2 + 3 =", 2 + 3) f. print(2 ** 3) g. print(2/3) h. print(2 // 3)
In this week's module we downloaded Python IDLE, read the rules every developer needs to
know, practiced print statements, and created a python script file.
d. The print statement ("2" + “3") uses quotation marks to make each number a separate
string. The addition operator tells the program to put the two numbers together. The result
is 23
e. The print statement ( "2 +3 =", 2+3) has quotation marks around the first equation so it
is executed first. A comma puts a space between the two answers. The result is, 2+3 = 5.
f. The print statement (2**3) uses the exponential **, making the equation, 2 to the power
of 3. The result is, 8.
Problem 1- Execute the following statements.
2 IDLE Shell 3.9.6
File Edit Shell Debug Options Window Help
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AM
D64) ] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
>>> #CITA-180 Module 1 - Problem l
>>> #Execute the following statements
>>> #Question A - Print the comment, Hello World!
g. The print statement (2/3) uses the division operative to divide 2 into 3, giving the result,
0.6666666666666666
h. The print statement (2//3)
>>> print ("Hello", "World!")
Hello World!
>>> #Question B- Print the integer 3.0
>>> print (3.0):
|
3.0
>>> #Question C - Execute print statement 2.0 + 3.0
>>> print (2.0 + 3.0)
5.0
>>> #Question D - Execute print statement ("2" + "3")
>>> print ("2" + "3")
23
>>> #Question E - Execute print statement ("2+3 =", 2+3)
>>> print ("2+3=", 2+3)
2+3= 5
>>> #Question F - Execute statement 2^3
>>> print (2**3)
8
>>> #Question G - Execute the statement 2 divided by 3
>>> print (2/3)
0.6666666666666666
>>> #Question H - Execute the statement 2^3 using double slashes
>>> print (2//3)
>>> |
Problem 1- Part 2- Explain the results.
а.
To execute the print statement, Hello World! ' quotation marks were used so the
program would know each word was a separate string and the comma separated the two
words. The result was, Hello World!
b. Print (3.0) is a single integer giving 3.0 as the result.
c. The print statement (2.0 +3.0) only includes one operator. a plus sign, to add the two
numbers together, making the result 5.0.
expand button
Transcribed Image Text:In this week's module we downloaded Python IDLE, read the rules every developer needs to know, practiced print statements, and created a python script file. d. The print statement ("2" + “3") uses quotation marks to make each number a separate string. The addition operator tells the program to put the two numbers together. The result is 23 e. The print statement ( "2 +3 =", 2+3) has quotation marks around the first equation so it is executed first. A comma puts a space between the two answers. The result is, 2+3 = 5. f. The print statement (2**3) uses the exponential **, making the equation, 2 to the power of 3. The result is, 8. Problem 1- Execute the following statements. 2 IDLE Shell 3.9.6 File Edit Shell Debug Options Window Help Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AM D64) ] on win32 Type "help", "copyright", "credits" or "license ()" for more information. >>> #CITA-180 Module 1 - Problem l >>> #Execute the following statements >>> #Question A - Print the comment, Hello World! g. The print statement (2/3) uses the division operative to divide 2 into 3, giving the result, 0.6666666666666666 h. The print statement (2//3) >>> print ("Hello", "World!") Hello World! >>> #Question B- Print the integer 3.0 >>> print (3.0): | 3.0 >>> #Question C - Execute print statement 2.0 + 3.0 >>> print (2.0 + 3.0) 5.0 >>> #Question D - Execute print statement ("2" + "3") >>> print ("2" + "3") 23 >>> #Question E - Execute print statement ("2+3 =", 2+3) >>> print ("2+3=", 2+3) 2+3= 5 >>> #Question F - Execute statement 2^3 >>> print (2**3) 8 >>> #Question G - Execute the statement 2 divided by 3 >>> print (2/3) 0.6666666666666666 >>> #Question H - Execute the statement 2^3 using double slashes >>> print (2//3) >>> | Problem 1- Part 2- Explain the results. а. To execute the print statement, Hello World! ' quotation marks were used so the program would know each word was a separate string and the comma separated the two words. The result was, Hello World! b. Print (3.0) is a single integer giving 3.0 as the result. c. The print statement (2.0 +3.0) only includes one operator. a plus sign, to add the two numbers together, making the result 5.0.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education