Python Lab Assignment 1 - AvniM/PythonDL_LabAssignments GitHub Wiki

Task1:

Read a file which includes at least two paragraphs. Calculate the word frequency for each word in the file.

Code Link : https://github.com/AvniM/PythonLabAssignments/blob/master/LabAssignment1/WordFrequency.py

Code Screenshot:

Input File Screenshot:

Output Screenshot:

The exception for incorrect file name is not handled-

Output File Link: https://github.com/AvniM/PythonLabAssignments/blob/master/LabAssignment1/OutputFile01.txt

Output File Screenshot:

Task 2

Write a Python program to check if a string contains all letters of the alphabet

Code Link: https://github.com/AvniM/PythonLabAssignments/blob/master/LabAssignment1/AllLettersAlphabet.py

Code Screenshot:

Output Screenshot:

Task 3

Write a Python program to find those numbers which are divisible by 5 and multiple of 2, between 700 and 1700

Code Link: https://github.com/AvniM/PythonLabAssignments/blob/master/LabAssignment1/DivisibleMultiple.py

Code Screenshot:

Output Screenshot:

Task 4

What is the difference between JVM and the Python interpreter?

  1. A Java compiler converts Java language into a byte-code stream no different than a C compiler converts C Language programs into assembly code. An interpreter on the other hand doesn't really convert the program into any well defined intermediate form, it just takes the program actions as a matter of the process of interpreting the source.

  2. Another difference between a VM and an interpreter is being language independent. Java VM is not Java specific. A compiler made from other languages that can be run on the JVM. On the other hand, compiling some other language other than Python into Python for interpretation by the Python interpreter is not possible.

REF: https://stackoverflow.com/questions/441824/java-virtual-machine-vs-python-interpreter-parlance