美文网首页Learn to Code
《笨办法学Python3》练习十一:问一些问题

《笨办法学Python3》练习十一:问一些问题

作者: 雨开Ame | 来源:发表于2019-03-01 14:58 被阅读0次

    练习代码

    print("How old are you?", end = ' ')
    age = input()
    print("Hoe=w tall are you?", end = ' ')
    height = input()
    print("How much do you weigh?", end = ' ')
    weight = input()
    
    print(f"So, you're {age} old, {height} tall and {weight} heavy.")
    

    Study Drills

    1. Go online and find out what Python’s input does.

    2. Can you find other ways to use it? Try some of the samples you find.

    3. Write another “form” like this to ask some other questions

    补充

    1. 通过input()获得的是string类型的数据,如果想获得一个整数,需要用int()转换。

    相关文章

      网友评论

        本文标题:《笨办法学Python3》练习十一:问一些问题

        本文链接:https://www.haomeiwen.com/subject/whpduqtx.html