编写函数showMsg(n,name),它可以输出n行的字符串“Happy Birthday ***”,如果“***”为小明,则输出n行的“Happy Birthday 小明”
举一反三
- 【单选题】def happy(): print("Happy birthday to you!") def happy_birthday(name): happy() print("Happy birthday, dear {}!".format(name)) happy() happy_birthday("teacher") A. Happy birthday to you! Happy birthday to you! Happy birthday, dear teacher! Happy birthday to you! B. Happy birthday to you! Happy birthday, dear teacher! Happy birthday to you! Happy birthday to you! C. Happy birthday to you! Happy birthday, dear teacher! Happy birthday, dear teacher! Happy birthday to you! D. Happy birthday to you! Happy birthday, dear teacher! Happy birthday to you!
- --Happy birthday!--______. A: Happy B: Happy birthday C: Thank you
- 有如下代码: StringBuffer buffer = new StringBuffer("Happy Birthday");buffer.insert(2, '5');System.out.println(buffer);则最后输出的结果是( ) A: Hap5py Birthday B: H5appy Birthday C: Ha5py Birthday D: Ha5ppy Birthday
- ---Happy birthday!--______
- 关于以下函数,说法正确的是()。[img=247x182]17e0ba9f8abfa16.jpg[/img] A: 函数类型void可以省略 B: 形参说明int n可以简化为n C: 函数功能是在一行上连续输出n个“*”字符 D: 函数功能是连续输出n行“*”字符