设为首页 收藏本站
查看: 847|回复: 0

[经验分享] python 学习记录一

[复制链接]

尚未签到

发表于 2018-8-7 08:47:15 | 显示全部楼层 |阅读模式
  #!/usr/bin/pytholn
  # -*- coding: UTF-8 -*-
  import math
  import sys
  def print_13():
  #for i in range(10):
  man_age = int(raw_input('enter input age:\n'))
  if man_age >= 10 and man_age <= 12:
  sex = str(raw_input('please input sex : M is the male or F a female and your is age :\n'))
  for i in range(10):
  print 'Can you join the team!'
  print 'Thank you for your cooperation'
  #break
  else:
  print "You are not satisfied"
  print print_13()
  def print_10():
  n = int(raw_input('enter number:\n'))
  if n % 3 ==0 and n % 5 == 0:
  print 'N can be divisible by 3 or 5 '
  else:
  print 'N not be divisible by 3 or 5'
  #print_10()
  def print_price():
  discount = 0
  pice = float(raw_input("Please enter the purchase price:\n"))
  if pice >= 50 and pice <= 100:
  discount = 0.1
  print 'The discount price is 10 %.'
  elif pice > 100:
  discount = 0.2
  print 'The discount price is 20%.'
  else:
  print 'sorry ! is not discount.'
  print pice * discount
  #print_price()
  def print_huashi():
  temperature = float(raw_input("please input temperature :\n"))
  c = 5.0 / 9 * (temperature - 3)
  print c
  #print_huashi()
  def print_sort():
  l = [0,2,3,4,5]
  k = []
  for i in l:
  k.insert(0,i)
  print k
  #print_sort()
  def print_number():
  str_num = '22222mmmm12232132312wqweqeqw'
  result = 0
  for i in str_num:
  if i in '0123456789':
  result += 1
  print result
  #print_number()
  def print_50():
  result = ''
  for i in range(1,51,1):
  if i == 50:
  result += str(i)
  else:
  result += str(i) +" "
  print result
  #print_50()
  def list_print():
  alist = [123,'abc',4.56,['inner','list'],7-9j]
  #print list_print()
  def  print_movices():
  movices = ["The Holey Grail","The life of Brian","The Meaning of life"]
  print movices[1]
  #print_movices()
  #比如abcd输出每一次减少一个字母输出
  def print_shusu():
  s = 'abcde'
  i = -1
  for i in range(-1,-len(s),-1):
  print s[:i]
  #print_shusu()
  def print_three():
  l = []
  for i in range(3):
  x = int(raw_input('three number\n'))
  l.append(x)
  l.sort()
  print l
  #print_three()
  print("----------------")
  #一个整数,它加上100后是一个完全平方数,再加上268又是一个完全平方数,请问该数是多少
  def print_math():
  for i in range(100000):
  x = int(math.sqrt(i + 100 ))
  y = int(math.sqrt(i + 268 ))
  if(x * x == i + 100) and (y * y == i + 268):
  print i
  #print_math()
  print("----------------")
  #有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
  def  print_sort():
  for i in range(1,5) :
  for j in range(1,5) :
  for k in range(1,5) :
  if(i != k ) and (i != j ) and (j !=k ):
  print i, j, k
  #print_sort()

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-547941-1-1.html 上篇帖子: Python Day5 下篇帖子: Python 小白第一天
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表