Menu

Python Programming [ Lab Programs ]


Python Installation and Documentation

Aim:

  I. Use a web browser to go to the Python website http://python.org. This page contains information about Python and links to Python-related pages, and it gives you the ability to search the Python documentation.


II. Start the Python interpreter and type help() to start the online help utility.

Solution :

I. Use a web browser to go to the Python website http://python.org. This page contains information about Python and links to Python-related pages, and it gives you the ability to search the Python documentation.


In this tutorial we are going to learn about installation of Python3 on Windows and Linux (Ubuntu)


Python installation procedure in Windows :


To install Python in windows, we have to download Python software pack from official website of Python Software Foundation.

  1. Go to https://www.python.org/

    The following page will displayed on your web browser.

    image

  2. Go to Downloads

    The following page will displayed on your web browser.

    image

  3. Download the latest version of python(now latest version:python 3.13.7) for windows


  4. After the successful completion of download,we need to run python-3.13.7-amd64.exe file

    Then the Python setup window will be displayed as shown in below.

    image

  5. Click on Install Now

    First we need to check Add Python 3.13.7 to PATH, And then click on Install Now, the Python setup progress window will be displayed as shown in below.

    image

  6. Setup was Successful

    The Python setup will take 2 to 3 minutes of time.After successful installation the following window will be displayed

    image

  7. Click on Close button

    That's it, Python Setup was Successful


Python Documentaion:

  1. Go to python official website www.python.org
    click on documentation page

    image

  2. Click on Python Docs, then the following window will be displayed.

    image

  3. Select version

    image
  4. Select topic

    image

Python3 installation procedure in Linux (Ubuntu) :


All most all Linux (Ubuntu) operating systems came up with python 2. 7. To check the python version in your Linux (Ubuntu) system, open terminal by pressing Ctrl + ALT + T and then type following command press enter.


$ python --version (or)  $ python -V

Then we get version of python i.e. Python 2.7.12


In this tutorial we are going to install Python 3 on Linux (Ubuntu) Operating System.

To install Python 3

  1. To update software packages on your system, execute the following command in terminal

    $ sudo apt-get update
    

  2. After successful updating of software packages, To install python3, execute the following command in terminal

    $ sudo apt-get install python3
    

  3. To check if python is install properlyor not, we will check the version of python

    $ python3 --version (or)  $ python3 -V
    

    Then we get version of python3 i.e. Python 3.13.x i.e, Python3 setup successful in Linux (Ubuntu) operating system.




II. Start the Python interpreter and type help() to start the online help utility.

To Start the Python interpreter in your Linux (Ubuntu) system, open terminal by pressing Ctrl + ALT + T and then type following command press enter.


$ python3

And then type following command press enter.


 >>> help() 

The following is the sample output screenshot


image

Related Content :

1.
I. Use a web browser to go to the Python website http://python.org. This page contains information about Python and links to Python-related pages, and it gives you the ability to search the Python documentation.
II. Start the Python interpreter and type help() to start the online help utility.    View Solution


2. Start a Python interpreter and use it as a Calculator.   View Solution


3. Write a program to calculate compound interest when principal, rate and number of periods are given.    View Solution


4. Read the name, address, email and phone number of a person through the keyboard and print the details.    View Solution


5. Print the below triangle using for loop.

5
4 4
3 3 3
2 2 2 2
1 1 1 1 1     View Solution


6. Write a program to check whether the given input is digit or lowercase character or uppercase character or a special character(use 'if-else-if' ladder)    View Solution


7. Python program to print all prime numbers in a given interval (use break)   View Solution


8. Write a program to convert a list and tuple into arrays.   View Solution


9. Write a program to find common values between two arrays.   View Solution


10. Write a function called palindrome that takes a string argument and returnsTrue if it is a palindrome and False otherwise. Remember that you can use the built-in function len to check the length of a string.    View Solution


11. Write a function called is_sorted that takes a list as a parameter and returns True if the list is sorted in ascending order and False otherwise.    View Solution


12. Write a function called has_duplicates that takes a list and returns True if there is any element that appears more than once. It should not modify the original list.    View Solution


13. Write a function called remove_duplicates that takes a list and returns a new list with only the unique elements from the original. Hint: they don't have to be in the same order.    View Solution


14. The wordlist I provided, words.txt, doesn't contain single letter words. So you might want to add "I", "a", and the empty string.    View Solution


15. Write a python code to read dictionary values from the user. Construct a function to invert its content. i.e., keys should be values and values should be keys.    View Solution


16. Add a comma between the characters. If the given word is 'Apple', it should become 'A,p,p,l,e'.    View Solution


17. Remove the given word in all the places in a string?    View Solution


18. Write a function that takes a sentence as an input parameter and replaces the first letter of every word with the corresponding upper case letter and the rest of the letters in the word by corresponding letters in lower case without using a built-in function?    View Solution


19. Writes a recursive function that generates all binary strings of n-bit length.   View Solution


20. Write a python program that defines a matrix and prints.   View Solution


21. Write a python program to perform multiplication of two square matrices.   View Solution


22. How do you make a module? Give an example of construction of a module using different geometrical shapes and operations on them as its functions.    View Solution


23. Use the structure of exception handling all general-purpose exceptions.   View Solution


24. Write a function called draw_rectangle that takes a Canvas and a Rectangle as arguments and draws a representation of the Rectangle on the Canvas.   View Solution


25. Add an attribute named color to your Rectangle objects and modify draw_rectangle so that it uses the color attribute as the fill color.   View Solution


26. Write a function called draw_point that takes a Canvas and a Point as arguments and draws a representation of the Point on the Canvas.   View Solution


27. Define a new class called Circle with appropriate attributes and instantiate a few Circle objects. Write a function called draw_circle that draws circles on the canvas.   View Solution


28. Write a python code to read a phone number and email-id from the user and validate it for correctness.   View Solution


29. Write a Python code to merge two given file contents into a third file.    View Solution


30. Write a Python code to open a given file and construct a function to check for given words present in it and display on found.   View Solution


31. Write a Python code to Read text from a text file, find the word with most number of occurrences.   View Solution


32. Write a function that reads a file file1and displays the number of words, number of vowels, blank spaces, lower case letters and uppercase letters.    View Solution


33. Import numpy, Plotpy and Scipy and explore their functionalities.    View Solution


34. Install NumPypackage with pip and explore it.    View Solution


35. Write a program to implement Digital Logic Gates - AND, OR, NOT, EX-OR.    View Solution


36. Write a GUI program to create a window wizard having two text labels, two text fields and two buttons as Submit and Reset.    View Solution