How can I convert a string to an int in Python?

前端 未结 8 1446
北恋
北恋 2020-11-27 21:35

The output I\'m getting for my little example app is the following:

Welcome to the Calculator!
Please choose what you\'d like to do:
0: Addition
1: Subtracti         


        
8条回答
  •  一生所求
    2020-11-27 22:32

    Don't use str() method directly in html instead use with y=x|string()

    {% for x in range(photo_upload_count) %} {% with y=x|string() %}
    {% if data['profile_photo']!= None: %} User profile picture {% else: %} User profile picture {% endif %}
    {% endwith %} {% endfor %}

提交回复
热议问题