zoukankan      html  css  js  c++  java
  • 爬取狮城bbs困扰了我一天的Python基础题

    结果在爱球球大哥的帮助下成功解决,代码如下

    a = ["2.5", "2.4", "2.9", "3.5"]
    b = ["-", "*", "-"]
    
    finally_str = ""
    for i in range(len(a)):
        finally_str = finally_str + a[i]
        finally_str = str(eval(finally_str))
        print(finally_str)
        try:
            finally_str = finally_str + b[i]
            print(finally_str)
        except Exception:
            break
    
    print(finally_str)
  • 相关阅读:
    spoj705
    bzoj2440
    spoj220
    bzoj2301
    hdu1695
    poj3294
    hdu3518
    poj3693
    函数
    样式
  • 原文地址:https://www.cnblogs.com/QimiSun/p/10416425.html
Copyright © 2011-2022 走看看