G关于python3基础代码的问题,type error:must be str, not int
发布网友
发布时间:2022-04-25 14:33
我来回答
共1个回答
热心网友
时间:2023-10-09 07:50
import random
name = input("Please enter your name:")
name = name.strip()
first_name, last_name = name.split()
index = str(random.randint(0, 999))
user_name = first_name[0].lower() + last_name[0:3].lower() + index.zfill(3)
print('Your username is', user_name)