0% found this document useful (0 votes)
10 views5 pages

Python Syntax and Operators Guide

Leaving out quotes when printing a name in Python results in a syntax error due to the language's strict syntax rules. The * operator is used for multiplication, while the ** operator is used for exponentiation. Python does not allow integers to be displayed with leading zeros, as they are interpreted as octal literals, and the type function differentiates between string and integer types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

Python Syntax and Operators Guide

Leaving out quotes when printing a name in Python results in a syntax error due to the language's strict syntax rules. The * operator is used for multiplication, while the ** operator is used for exponentiation. Python does not allow integers to be displayed with leading zeros, as they are interpreted as octal literals, and the type function differentiates between string and integer types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

.

If you are trying to print your name, what happens if you leave out one or both of the
quotes, and why?

It says "error", that is, an error in the syntax, because Python is a formal language, I would
say that "Precision is the mother of formal languages"
b. What is the difference between * and ** operators in Python? Explain it with the
help of an example.
1. multiplication 2. exponentiation (raises a number to the power)
3*2=6
6**6=36
c. In Python, is it possible to display an integer like 09? Justify your answer.
Python has a literal interpretation, so it classifies both numbers as an integer, using quotes.
d. Run the type('67') and type(67) commands. What is the difference in output and
why?
At the first mark a syntax error due to the governance of certain programming laws, That is
why in both their results were different.
a.
b.

c.
d.

You might also like