python字符串

python学习网 2018-11-15 08:25:02

python字符串连接

方法一:

info = '''

--------------info of %s -----------------

name:%s

age:%s

'''%s(name,age)

方法二:

# -*- coding:utf-8 -*-

_username="Bill"
_password="111111"
username=input("username:")
password=input("password:")
if _username == username and _password == password:
print("Welcome user {name} login...".format(name=username))
else:
print("Invalid username or password!")

print("OK!")

 

 

系统默认输入的字符为字符串格式

 

循环:

break,跳出整个循环;

continue,跳出本次循环,进行下次循环。

 

注释:

当行注视:# 被注释内容

多行注释:""" 被注释内容 """

阅读(1134) 评论(0)