你看我又睡着啦 2022-09-22 00:12 采纳率: 66.7%
浏览 32
已结题

python中这种print怎么竖着实现

问题遇到的现象和发生背景 python中这种print怎么竖着实现 不想用多个print的话

类似这样
First name:
Last name:
Age:
Location:

用代码块功能插入代码,请勿粘贴截图
a = input("Please write down your first name:")
b = input("Please write down your last name:")
c = input("Please write down your age:")
d = input("Please write down your location:")
print("First name:",a,"Last name:",b,"Age:",c,"Location:",d)

初步尝试

a = input("Please write down your first name:")
b = input("Please write down your last name:")
print("First name",a /
      "Last name",b)

结果会出现
TypeError: unsupported operand type(s) for /: 'str' and 'str'
可是我的print里的数据都是字符串,不理解

  • 写回答

2条回答 默认 最新

  • 爱音斯坦牛 全栈领域优质创作者 2022-09-22 03:17
    关注
    
    a = input("Please write down your first name:")
    b = input("Please write down your last name:")
    c = input("Please write down your age:")
    d = input("Please write down your location:")
    print("First name:",a)
    print("Last name:",b)
    print("Age:",c)
    print("Location:",d)
     
    

    这样就行,有帮助的话采纳一下哦!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 9月30日
  • 已采纳回答 9月22日
  • 修改了问题 9月22日
  • 创建了问题 9月22日

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度