Answer To: Project Report Guidelines About this assignment: This assignment consists of 2 parts: a theory part...
Aniket answered on Nov 30 2021
{"metadata":{"language_info":{"name":"python","version":"3.7.8","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"#LIST COMPREHENSION VS LOOP\n","metadata":{"trusted":true},"execution_count":1,"outputs":[]},{"cell_type":"code","source":"l=[1,2,3,4,5,6,7,8,9,10]\neven_loop=[]\neven_list_comprehension=[]\nfor i in l:\n if i%2==0:\n even_loop.append()\n\neven_list_comprehension=[number for number in l if not number % 2]","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#list vs dictionary","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"l=[1,2,3,4,5,6,7,8,9]\nd={1:1,2:2,3:3}\nprint(l)\nprint(d)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#function vs code not in function\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fun fact(n):\n f=1\n for i in range(1,n+1):\n f=f*i\n return f\n\nprint(fact(3))\n\nfact=1\nfor i in range(1,4):\n fact=fact*i\nprint(fact)\n ","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#class Object vs not in class/object\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"class vehicle:\n def...