final print statement. When I plugged in print(2**3) or 2^3, the result was 8, which is accurate. When I did the same with print(2//3), the result was zero. Isn't // the same as **, to the power of? I don't understand why the double slashes resulted in a different answer
final print statement. When I plugged in print(2**3) or 2^3, the result was 8, which is accurate. When I did the same with print(2//3), the result was zero. Isn't // the same as **, to the power of? I don't understand why the double slashes resulted in a different answer
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Hi, I am working on a problem in beginner's Python and wanted to make sure I was explaining the results properly. I also had a question about my final print statement. When I plugged in print(2**3) or 2^3, the result was 8, which is accurate. When I did the same with print(2//3), the result was zero. Isn't // the same as **, to the power of? I don't understand why the double slashes resulted in a different answer. I attached my work below.
![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 (AMD64) ] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
>>>
>>> #CITA 180
>>> #Execute the following statements
- Module 1
Problem l
>>>
>>> #Print Hello World!
>>> print ("Hello", "World!")
Hello World!
>>>
>>> #Print 3.0
>>> print (3.0)
3.0
>>>
>>> #Add 2.0 + 3.0
>>> print (2.0 + 3.0)
5.0
>>>
>>> #Print number 2 first and number 3 second
>>> print ( "2" + "3")
23
>>>
>>> #Print 2 + 3 = 5
>>> print ("2+3="
• 2+3)
2+3= 5
>>>
>>> #Print 2 to the power of 3
>>> print (2**3)
8.
>>>
>>> #Print 2 divided by 3
>>> print (2/3)
0.6666666666666666
>>>
>>> #Print 2 to the power of 3
>>> print (2//3)
>>>](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F320d40c1-ce5b-4bba-aca7-8e1e96f8a3e0%2F6d9646bb-dd9f-4bf1-9d60-098863128206%2Fmpehfhs_processed.png&w=3840&q=75)
Transcribed Image Text: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 (AMD64) ] on win32
Type "help", "copyright", "credits" or "license ()" for more information.
>>>
>>> #CITA 180
>>> #Execute the following statements
- Module 1
Problem l
>>>
>>> #Print Hello World!
>>> print ("Hello", "World!")
Hello World!
>>>
>>> #Print 3.0
>>> print (3.0)
3.0
>>>
>>> #Add 2.0 + 3.0
>>> print (2.0 + 3.0)
5.0
>>>
>>> #Print number 2 first and number 3 second
>>> print ( "2" + "3")
23
>>>
>>> #Print 2 + 3 = 5
>>> print ("2+3="
• 2+3)
2+3= 5
>>>
>>> #Print 2 to the power of 3
>>> print (2**3)
8.
>>>
>>> #Print 2 divided by 3
>>> print (2/3)
0.6666666666666666
>>>
>>> #Print 2 to the power of 3
>>> print (2//3)
>>>
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 now
This is a popular solution!
Step by step
Solved in 2 steps

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.Recommended textbooks for you

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

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