solution1.tex 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. \documentclass[a4paper,11pt,openright]{report}
  2. \setlength{\parindent}{0pt} % set noindent for entire file
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{times}
  5. \usepackage{t1enc}
  6. \usepackage[a4paper, left=20mm, right=20mm, top=10mm]{geometry}
  7. \usepackage{xcolor,graphicx}
  8. \usepackage{amsmath}
  9. \usepackage{setspace}
  10. \usepackage{sectsty}
  11. \usepackage{etoolbox}
  12. \usepackage{enumitem}
  13. \usepackage{listings}
  14. \usepackage{helvet}
  15. \lstdefinestyle{mystyle}{
  16. basicstyle=\ttfamily\footnotesize,
  17. breakatwhitespace=false,
  18. breaklines=true,
  19. captionpos=b,
  20. keepspaces=true,
  21. showspaces=false,
  22. showstringspaces=false,
  23. showtabs=false,
  24. tabsize=2
  25. }
  26. \lstset{style=mystyle}
  27. \begin{document}
  28. \singlespacing
  29. \pagestyle{plain}
  30. \pagenumbering{arabic}
  31. \begin{center}
  32. \textbf{Answers to Question Set 1} \\
  33. Date: 20/04/2020 \hspace{2mm} Name: D.Saravanan
  34. \end{center}
  35. \vspace{20px}
  36. \textbf{Question 1:} \\
  37. Print "Hello world" in python using all the possible methods. \\
  38. \lstinputlisting[language=Python]{question1.py}
  39. \vspace{30px}
  40. \textbf{Question 2:} \\
  41. What are all the different Python Distributions available ? \\
  42. Python Distributions aside from the offical CPython distribution:
  43. \begin{itemize}
  44. \item ActivePython
  45. \item Anaconda
  46. \item ChinesePython Project
  47. \item Enthought's Canopy
  48. \item Ipython and its IPyKit variant
  49. \item IronPython
  50. \item Jython
  51. \item MesaPy
  52. \item MicroPython
  53. \item PocketPython
  54. \item Portable Python
  55. \item Pycopy
  56. \item PyIMSL Studio
  57. \item PyPy
  58. \item Python(x,y)
  59. \item PythonForArmLinux
  60. \item PythonLabsPython
  61. \item PythonwarePython
  62. \item RustPython
  63. \item StacklessPython
  64. \item Tiny Python
  65. \item Win9xPython
  66. \item WinPython
  67. \end{itemize}
  68. \vspace{30px}
  69. \textbf{Question 3:}\\
  70. i. Person A has a slow computer but he is well versed in python programming which Python run
  71. method will you suggest him.\\
  72. a) Python Shell and c) IPython\\
  73. ii. Person B having a decent computer is new to Python which Python run method will you
  74. suggest him.\\
  75. b) Jupyter notebook and c) IPython\\
  76. \vspace{30px}
  77. \textbf{Question 4:}\\
  78. Write a python code to get two string from user and display them in two lines.\\
  79. Note: Program should be of 2 lines only\\
  80. \lstinputlisting[language=Python]{question4.py}
  81. \end{document}