开发者社区> 问答> 正文

多条件逻辑关系怎么写呢? python问题

我想写一个 while 循环条件 name !='' && re.match(name)!= None 总是报语法错误,怎么回事呢?

展开
收起
海边一只船 2020-05-28 13:30:19 774 0
1 条回答
写回答
取消 提交回答
  • # -*- coding: UTF-8 -*-
    import re
    
    name = "123"
    while name!="" and re.match("\\d+", name)!= None:
        print("inside the while loop")
        name = "aa"
    print("outside the while loop")
    
    
    2020-05-29 18:15:36
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载