描述
开学了,你考上了武汉理工大学,校园的电子屏上显示着以下欢迎界面:
|++++++++++++++++++++++|| || Welcome to WHUT || ||++++++++++++++++++++++|
编写程序,用户入自己的姓名,输出以上界面后,再在下一行输出“欢迎您,*同学!”
示例
输入**
李明
输出:    
|++++++++++++++++++++++|| || Welcome to WHUT || ||++++++++++++++++++++++|欢迎您,李明同学!
# ------------ ------- -------- ----------- -----------# @File : 1.4.2 欢迎入学.py# @Contact : vasp@qq.com# @Copyright : 2018-2025, Wuhan University of Technology# @Modify Time: 2021/4/26 10:01# @Author : 赵广辉# @Version : 1.0# @License : 仅限用于Python程序设计基础实践教程(赵广辉,高等教育出版社)配套实验# ------------ ------- -------- ----------- -----------# 实验要求# 开学了,你考上了武汉理工大学,校园的电子屏上显示着以下欢迎界面:# |++++++++++++++++++++++|# | |# | Welcome to WHUT |# | |# |++++++++++++++++++++++|# 1.请编程输出以上界面# 以下为代码区print('|++++++++++++++++++++++|')print('| |')print('| Welcome to WHUT |')print('| |')print('|++++++++++++++++++++++|')# 2.编写程序,用户入自己的姓名,在上述欢迎界面下输出“欢迎您,***同学!”# 输入# >>>李明# 输出# |++++++++++++++++++++++|# | |# | Welcome to WHUT |# | |# |++++++++++++++++++++++|# 欢迎您,李明同学!# 以下为代码区my_name = input() # 输入学生的姓名print('|++++++++++++++++++++++|')print('| |')print('| Welcome to WHUT |')print('| |')print('|++++++++++++++++++++++|')print(f'欢迎您,{my_name}同学!')
def print_plus():print('|++++++++++++++++++++++|')def print_space():print('| |')def print_uni(uni_name):print(f'| Welcome to {uni_name} |')def print_name(stu_name):print(f'欢迎您,{stu_name}同学!')if __name__ == '__main__':uni_name = input()stu_name = input()print_plus()print_space()print_uni(uni_name)print_space()print_plus()print_name(stu_name)
