首页 > 其他 > 详细

if语句用户交互字符串

时间:2019-07-02 21:42:24      阅读:86      评论:0      收藏:0      [点我收藏+]

字符串

字符串相加

a = "alex"
b = "wusir"
prin("a+b")

字符串相乘

a = "alex"
print(a*3)

用户交互

import getpass
name = input("请输入你的用户名:")
password = getpass.getpass("请输入你的密码:")          #只能在cmd中运行
print(password)      

if语句

if 3>2:
    print("yes")
if 3>1
    print("yes too")
a = int(input("输入一个数:"))
if a>2:
    print("hello")
else:
    print("hello world")
age =20
if age < 18:
    print("too young")
elif age < 30 and age >18:
    print("也不小了")
else:
    print("还能折腾几年啊")
if 50>0:
    print(666)
    if 20>0:
        print(6666)
        if 10>0:
            print(66666)
else:
    pass

if语句用户交互字符串

原文:https://www.cnblogs.com/qwe911/p/11122911.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!