You are responsible for all material covered through the end of Week 2, with the exception of the accumulator pattern. You are not responsible for Unix or atom specific information.
Your quiz will be on paper, so be sure to practice the concepts below on paper including writing simple programs
int
, float
, str
=
input()
type()
int()
, str()
, float()
and type conversionprint()
def main():
for
loops $ python gallons.py
Gallons: 2
That's 7.58 liters.
For example, the answer to the first one (2 + 3
) would be value 5
and type int
(or integer
).
Marco
and studies
, output: The nation was riveted to see the beloved Marco on TV.
He studies better than any person in history
$ python bill.py
Room rate: 100
Total nights: 3
-------------------
Tax: $ 18.0
Tourism Fee: $ 31.5
Total: $ 349.50
for i in range(4):
print(i)
print("-----")
for x in range(6):
print("x =",x)
print("done!")
word = "hello!"
num_chars = len(word)
for i in range(num_chars):
print("---" + word[i] + "---")