Assignment 1
Assignment 1
'hello'
-87.8
6
Answer:
Values: 'hello', -87.8, 6
Expressions: *, -, /, +
Integers – This value is represented by int class. It contains positive or negative whole
numbers (without fraction or decimal). In Python there is no limit to how long an
integer value can be.
Float – This value is represented by float class. It is a real number with floating point
representation. It is specified by a decimal point. Optionally, the character e or E
followed by a positive or negative integer may be appended to specify scientific
notation.
Complex Numbers – Complex number is represented by complex class. It is specified
as (real part) + (imaginary part) j. For example – 2+3j
6. After running the following code, what does the variable bacon contain?
bacon = 22
22
bacon + 1
23
'spam' + 'spamspam'
'spamspamspam'
'spam' * 3
'spamspamspam'