第二次作业
str1 = 'itheima'
for i in str1:
print(i)
str1 = 'itheima'
for i in str1:
if i == 'e':
print('遇到e不打印')
break
print(i)
bicycle =['jim' , 'kom' , 'tom']
bicycle.append('him')
print(bicycle )
['jim', 'kom', 'tom', 'him']
str1 = 'itheima'
for i in str1:
if i == 'e':
print('遇到e不打印')
continue
print(i)
i
t
h
遇到e不打印
i
m
a
name = "abcdef"
print(name[2])
print(name[0])
print(name[1])
c
a
b
name = input('请输⼊您的名字:')
print(f'您输⼊的名字是{name}')
print(type(name))
password = input('请输⼊您的密码:')
print(f'您输⼊的密码是{password}')
print(type(password))
请输⼊您的名字:tom
您输⼊的名字是tom
<class 'str'>
请输⼊您的密码:123456
您输⼊的密码是123456
<class 'str'>