你看我又睡着啦 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日

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?