
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
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.

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.](https://content.bartleby.com/qna-images/question/320d40c1-ce5b-4bba-aca7-8e1e96f8a3e0/de3e415d-8082-42b9-a3ec-f829cb72da05/3k6hh8b_thumbnail.png)
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
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
- I need help with this. I'm having trouble with the whitespace part. I tried many different things but none of them work. I'm using Python.arrow_forwardInstead of using: print(f"You should be spending {hours_inhome} hours on homework outside of class every week") for a beginner in python what is an alternative to using "f" and the { } signs for when you type in print. Also can you explain what the f means and what "{ }" these signs are?arrow_forwardProgress (100%) Item 3/10 A console What do you call a command-line interpreter which lets you interact with your OS and execute Python commands and scripts? A compiler Jython An editor e Type here to search PCarrow_forward
- I'm currently trying to work on a modified problem from C++ Engineering and Science (Chapter 7.2, Problem 4e). I've compiled the project and tried to run it, only to get -858993460 as an output. I don't know if this is a technical problem with the program I'm using (visual studio) or if I just did the program incorrectly, but I've been having these issues since I've first downloaded visual studio, and IDK how to properly fix them. I'll provide the instructions below this (with the modifications in bold), as well as the code I have. All I ask is to get some pointers on how to fix the code. Declare and initialize an array named Resistances that holds the following values: 16, 27, 39, 56, 81. You must also create additional arrays named Current, Voltage, and Power, each with the same size as the Resistances array. Set up a for loop to allow the user to enter the ‘current’ values to be stored in the array named Current when the program is run. (This must be able to accept decimal numbers).…arrow_forwardOne of the files is the instructions. One is what I have so far. My question's are: I'm confused about what they mean by holds the following data attributes. Do I write any code for that? ALSO: for list of number of gear teeth values- I'm not sure what they mean by should have a length equal to... etc. How would I write that in python? Thanksarrow_forwardIn C++, the first element of the array is referenced as array[0]. Explore the web and find the history of this choice. Some languages and packages like MATLAB start the indices from 1. That is, the first element of the array is referred to as array[1] not array[0]. If you were the creators of C++, which of the conventions for the array indices would you chose? Starting from 0 or 1.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education