You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

02 Print Statement.py 3.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # ---
  2. # jupyter:
  3. # jupytext_format_version: '1.2'
  4. # kernelspec:
  5. # display_name: Python 3
  6. # language: python
  7. # name: python3
  8. # language_info:
  9. # codemirror_mode:
  10. # name: ipython
  11. # version: 3
  12. # file_extension: .py
  13. # mimetype: text/x-python
  14. # name: python
  15. # nbconvert_exporter: python
  16. # pygments_lexer: ipython3
  17. # version: 3.5.2
  18. # ---
  19. # All the IPython Notebooks in this lecture series are available at https://github.com/rajathkumarmp/Python-Lectures
  20. # # Print Statement
  21. # The **print** statement can be used in the following different ways :
  22. #
  23. # - print("Hello World")
  24. # - print("Hello", <Variable Containing the String>)
  25. # - print("Hello" + <Variable Containing the String>)
  26. # - print("Hello %s" % <variable containing the string>)
  27. print("Hello World")
  28. # In Python, single, double and triple quotes are used to denote a string.
  29. # Most use single quotes when declaring a single character.
  30. # Double quotes when declaring a line and triple quotes when declaring a paragraph/multiple lines.
  31. print('Hey')
  32. print("""My name is Rajath Kumar M.P.
  33. I love Python.""")
  34. # Strings can be assigned to variable say _string1_ and _string2_ which can called when using the print statement.
  35. # + {"scrolled": true}
  36. string1 = 'World'
  37. print('Hello', string1)
  38. string2 = '!'
  39. print('Hello', string1, string2)
  40. # -
  41. # String concatenation is the "addition" of two strings. Observe that while concatenating there will be no space between the strings.
  42. print('Hello' + string1 + string2)
  43. # **%s** is used to refer to a variable which contains a string.
  44. print("Hello %s" % string1)
  45. # Similarly, when using other data types
  46. #
  47. # - %s -> string
  48. # - %d -> Integer
  49. # - %f -> Float
  50. # - %o -> Octal
  51. # - %x -> Hexadecimal
  52. # - %e -> exponential
  53. #
  54. # This can be used for conversions inside the print statement itself.
  55. print("Actual Number = %d" % 18)
  56. print("Float of the number = %f" % 18)
  57. print("Octal equivalent of the number = %o" % 18)
  58. print("Hexadecimal equivalent of the number = %x" % 18)
  59. print("Exponential equivalent of the number = %e" % 18)
  60. # When referring to multiple variables parenthesis is used.
  61. print "Hello %s %s" %(string1,string2)
  62. # ## Other Examples
  63. # The following are other different ways the print statement can be put to use.
  64. print("I want %%d to be printed %s" %'here')
  65. print('_A'*10)
  66. print("Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug")
  67. print("\n".join("Jan Feb Mar Apr May Jun Jul Aug".split(" ")))
  68. print("I want \\n to be printed.")
  69. print """
  70. Routine:
  71. \t- Eat
  72. \t- Sleep\n\t- Repeat
  73. """
  74. # # PrecisionWidth and FieldWidth
  75. # Fieldwidth is the width of the entire number and precision is the width towards the right. One can alter these widths based on the requirements.
  76. #
  77. # The default Precision Width is set to 6.
  78. "%f" % 3.121312312312
  79. # Notice upto 6 decimal points are returned. To specify the number of decimal points, '%(fieldwidth).(precisionwidth)f' is used.
  80. "%.5f" % 3.121312312312
  81. # If the field width is set more than the necessary than the data right aligns itself to adjust to the specified values.
  82. "%9.5f" % 3.121312312312
  83. # Zero padding is done by adding a 0 at the start of fieldwidth.
  84. "%020.5f" % 3.121312312312
  85. # For proper alignment, a space can be left blank in the field width so that when a negative number is used, proper alignment is maintained.
  86. print "% 9f" % 3.121312312312
  87. print "% 9f" % -3.121312312312
  88. # '+' sign can be returned at the beginning of a positive number by adding a + sign at the beginning of the field width.
  89. print "%+9f" % 3.121312312312
  90. print "% 9f" % -3.121312312312
  91. # As mentioned above, the data right aligns itself when the field width mentioned is larger than the actualy field width. But left alignment can be done by specifying a negative symbol in the field width.
  92. "%-9.3f" % 3.121312312312

机器学习越来越多应用到飞行器、机器人等领域,其目的是利用计算机实现类似人类的智能,从而实现装备的智能化与无人化。本课程旨在引导学生掌握机器学习的基本知识、典型方法与技术,通过具体的应用案例激发学生对该学科的兴趣,鼓励学生能够从人工智能的角度来分析、解决飞行器、机器人所面临的问题和挑战。本课程主要内容包括Python编程基础,机器学习模型,无监督学习、监督学习、深度学习基础知识与实现,并学习如何利用机器学习解决实际问题,从而全面提升自我的《综合能力》。