这篇来说一下相乘和成员资格

代码如下:

示例1 

1 #相乘
2 print("python " * 5)

输出结果:

python python python python python 

实例2

1 #成员资格
2 student_name = ("Linda","Alixe")
3 print("Linda" in student_name)
4 
5 student_database = [["zyt",22],["Ly",23]]
6 name1 = input("请输入name:")
7 age1 = input("请输入年龄:")
8 print([name1,int(age1)] in student_database)

输出结果

True
请输入name:zyt
请输入年龄:22
True

 

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-07-21
  • 2022-12-23
  • 2021-09-21
  • 2021-05-28
  • 2021-05-01
  • 2021-10-30
猜你喜欢
  • 2022-02-01
  • 2022-12-23
  • 2022-02-09
  • 2021-06-24
  • 2021-09-16
  • 2021-08-22
相关资源
相似解决方案