如何将两个变量连接在一起创建用户名?
name = input("enter name: ") age = int(input("enter age: ")) username = (name[0,3] + str(age)) print(username)
这给了我一个,type error但我不确定我做错了什么.我希望名字的前三个字母与年龄相结合,以形成一个新的用户名.有人可以帮帮我吗!
type error
python python-3.x
python ×1
python-3.x ×1