python3 base 1

function: python basic grammar exercises
. "" "

#import this

name = "tom"
age = 29

str1 = "hello, " + name + "; age," + str(age)
str2 = "hello, %s ; age, %d " %(name, age)
str3 = "hello, {n} ; age, {a}".format(n=name, a=age)
print(str3)


# n = input("input you name:")
# print("hello-->", name)

# Use of quotes
print ( "He said:! 'Hello'")
Print ( 'He said:! "Hello"')

'' '
' ''
# Sequence, branched, cyclic

"" "
A == B equal to
a> = b greater than or equal
a <= b is equal to less than
a = b is not equal to!
A IS B is
a is not b is not
" ""
A. 4 =
B =. 5
IF A> B:
Print ( "Big A")
the else:
Print ( "Big B")

if True:
print("run this info")

c = True
if c is True:
print("run this info")

if c is not False:
print("run this info")

d = None
if d is None:
print("d is None")

number = 77
if number > 90:
print("优秀")
elif number > 70:
print("良好")
elif number > 60:
print("及格")
else:
print("不及格")


hello = "hello"
for i in hello:
print(i)

Guess you like

Origin www.cnblogs.com/hy546880109/p/12041857.html