You are on page 1of 9

Swami Keshvanand Institute

of Technology, Management & Gramothan


(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

Department of Electronics and Communication Engineering


Course: Skill Development Laboratory
Name of Student Archita Gocher

Roll Number 20ESKEC022


Python, Java
Name of the software learned during this
laboratory course

Online Certification details with Date 1. Python programming


2. Java for Beginners
Details of the project completed during this laboratory course:
1. Python Programming:
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

Python is a high-level programming language known for its simplicity, readability, and
versatility. Created by Guido van Rossum and first released in 1991, Python has since
become one of the most popular programming languages worldwide, used for a wide
range of applications, including web development, data analysis, artificial intelligence,
scientific computing, and more.
Python's extensive standard library provides a rich set of modules and packages for
performing common tasks, such as file I/O, networking, database access, and more.
This vast collection of libraries makes it easy for developers to build powerful and
complex applications without reinventing the wheel.
One of Python's key features is its support for multiple programming paradigms,
including procedural, object-oriented, and functional programming. This flexibility
allows developers to choose the most appropriate approach for their projects and
encourages code reuse, modularity, and maintainability.
Python's popularity in the field of data science and machine learning has surged in recent
years, thanks to its rich ecosystem of libraries and frameworks, including NumPy,
pandas, scikit-learn, TensorFlow, and PyTorch. These libraries provide powerful tools
for data manipulation, analysis, visualization, and machine learning, making Python the
de facto language for data scientists and machine learning engineers.
Python's versatility and ease of integration with other languages and technologies further
contribute to its popularity. Python can be seamlessly integrated with C/C++, Java, and
other languages, allowing developers to leverage existing codebases and take advantage
of the strengths of different programming languages within the same project.
Furthermore, Python's cross-platform compatibility ensures that code written in Python
can run on various operating systems, including Windows, macOS, and Linux, without
modification. This makes Python an attractive choice for developing cross-platform
applications and ensures maximum portability and interoperability.
In summary, Python's combination of simplicity, versatility, and community support
makes it an indispensable tool for developers across industries. Whether you're a
seasoned programmer or just starting your coding journey, Python offers a welcoming
environment and a wealth of opportunities for learning, innovation, and collaboration.
As technology continues to evolve, Python is poised to remain at the forefront of
innovation, driving progress and empowering individuals and organizations to achieve
their goals.
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

2. Java for Beginners:

What is Java?
Java is an object-oriented programming language used in distributed environments on the
internet. It is a high-level language that is also easy to read and understand. With it,
developers can “write once, run anywhere” (WORA), meaning that the compiled Java code
will run on all Java-compatible platforms without the need for recompilation.

What is Java Used For? Java is widely used in web consoles, GUIs, web and mobile
applications, game development, embedded systems, and desktop applications. Apart from
these, Java is also used to develop software for devices. It is used not only in computers and
mobile devices, but even in electronic devices like televisions, air conditioners, washing
machines, and so on. Online registration forms, banking apps, and shopping via the internet
are all possible because of Java.

Java Concepts The essential concepts in Java are its object-oriented programming (OOPs)
features. OOP simplifies software and application development as well as maintenance by
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

providing some concepts such as:

 Object: Object is an element or an entity that has a state and behavior. For example, a dog
can be considered an object with a color, a breed, and a name. It has behaviors such as
barking and eating.
 Class: A class is a collection of multiple objects. It is a blueprint that can be used to create
as many objects as you like. Classes are used to organize code, just like how fruits,
vegetables, and clinical products are divided into different sections in a supermarket.
 Constructor: Constructor may look like a method, but it is not one. Its name is the same as
the class name, and it does not return any value.
 Inheritance: Inheritance is the concept where one class acquires the properties and the
behaviors of the parent class.
 Polymorphism: Polymorphism is the process of performing the same task in different
ways. It lets programmers use the same word to mean different things in different contexts.
 Abstraction: Abstraction in Java is used to hide internal details and show only the relevant
essential details.
 Encapsulation: Binding or wrapping code and data together into a single unit (like a
capsule) are known as encapsulation. A Java class is an example of encapsulation.

Java OOPs Concepts

There are four main concepts of object-oriented programming (OOP), including:

1. Abstraction

Abstraction means showing the relevant details and hiding all the backend or internal details.
In the example below, for a student to be admitted into the college, the relevant details asked
will be the name, address, parent’s name, and high school marks. Details like favorite sports,
food, or movies are not relevant.

2. Encapsulation

Encapsulation is similar to a capsule. The entire code and all of the data are bound together in
a single unit. All the methods and variables are stored under one class name, and the same
class object can use it.

3. Polymorphism
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

Polymorphism means one task is performed in different ways. One function is used for
different tasks. In the example below, Method draw() can be used in different places to draw
different shapes, like a triangle, rectangle, or circle.

4. Inheritance

When one class inherits certain properties and attributes of other classes, it is known as
inheritance. There is always a superclass and a subclass. The subclass inherits attributes from
the superclass. In the example below, the animal is a superclass that has attributes eat() and
sleep(). Subclasses reptile, mammal, and human inherit these attributes.

Java Features

Java has several qualities and features, including:

 The simple syntax that is very easy to understand and learn


 Java language is robust
 Eliminates errors that occur in the C and C++ languages
 Java comprises of features like garbage collectors and exception handling
 As a portable language, Java can run on any platform
 Java is secure and can perform multitasking
 Java is not as fast as C and C++, but it provides higher performance than any other
language.

PROJECT:
Random Password Generator using Python

Passwords are critical for authentication. This prevents unauthorized access to any website or
portal where a possibility for misuse of information or identity theft persists. A password is a
combination of lowercase, uppercase, symbols, and digits. An ideal or a strong password
contains a combination of these four. The length is also crucial in determining a password’s
strength with the suitable length being above 10 characters unless specified otherwise.
These are the steps to build password generator python project:

1. Import random and tkinter modules


2. Define password generator function
3. Define character string
4. Create the user interface
Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

5. Add input widgets


6. Button to call the translate function

1. Import random and tkinter modules

Code Explanation:

 Import random: To randomly generate a password we use this module. Random is a


built-in module used to generate a random subset or a substring of a list, array or string.
In our case, it will generate a random string containing characters from the original string.
 from tkinter import messagebox: In case the user fails to provide inputs, we must raise
a prompt. Thus we use messagebox to raise such prompts
 from tkinter import *: To use widgets and define the application interface, we import
tkinter

2. Define password generator function

3. Define character string:


Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

Code explanation:

 character_string: A password must contain lowercase and uppercase characters, numbers


and symbols for better security. Thus we define a character string containing lowercase,
uppercase letters, numbers and symbols.

4. Create the user interface

Code explanation:

 password_gen: Invoke the class tkinter using Tk(). This contains provisions to handle
user events and widgets.
 password_gen.geometry(): Define the dimensions of the frame of the application in the
format lengthxbreadth
 password_gen.title(): An optional parameter to set the title of the application.

5. Add input widgets

6. Button to call the translate function:


Swami Keshvanand Institute
of Technology, Management & Gramothan
(Accredited by NAAC with 'A++ Grade)
Approved by AICTE, Ministry of Education, Government of India
Recognized by UGC under Section 2(f) of the UGC Act, 1956
Affiliated to Rajasthan Technical University, Kota

Code explanation:

 Password_button: Buttons perform a certain function when the user clicks on it. Link
the generate_password function to the button using command argument along with
password_gen and name of the button. Place the widget using place().
 password_gen.mainloop(): To close the app when the user clicks on exit

Python Password Generator Output:

Summary
We have successfully created python password generator. This python project also provided
an introduction to a random module that can be used to generate a random number or a
substring. An introduction to Tkinter using simple widgets is also provided.

You might also like