Learning Python 02

python

Hello World

new file

print

_print(“Hello World”)

Hello World

_name = “Cookie” _
_age = “30” _
_is_male = True _
_print(“This is ” + name) _
_print(“He was ” + age + “ years old.”) _
_print(“He is male : “ + str(is_male)) _

This is Cookie
He was 30 years old.
He is male : True

doc = “This is doc.”
print(doc)

This is doc.

lower = “ABCDEFG”
print(lower + “ change to upper : “ + lower.lower())

ABCDEFG change to upper : abcdefg

upper = “abcdeft”
print(upper + “ change to lower : “ + lower.upper())

abcdeft change to lower : ABCDEFG

print(lower.isupper())
print(“Is this upper ? ” + str(lower.isupper()))

True
Is this upper ? True

_is_upperfalse = “aABCDEFG”
_print(is_upperfalse.isupper())
_print(“Is this upper ? ” + str(is_upperfalse.isupper()))

False
Is this upper ? False

_lensrc = “abcdefghijklmn”
_print(len(lensrc))
_print(lensrc[0])
_print(lensrc[13])

14
a
n

_print(lensrc.index(“b”))
_print(lensrc.index(“cde”))

1
2

_print(len_src.replace(“a”, “1”))__

1bcdefghijklmn

Link To Mike Dane YouTuBe