Skip to main content

Top 50 Python Interview Question (Most popular in interview) | Python Top 50 Interview Question & Answer

 ðŸ˜‚ Python Top 50 Interview Question & Answer. It will help you to get a job. This is a collection of best interview question in python. it is very using full for you. 

1.What is Python..?😀

Ans-Python is a programming language it  was developed by Guido van 

Rossum, a Dutch Scientist to created at the center

For Mathematics and research Netherland. It is inspired by another

a programming language called "ABC", Guido started Pyhton development as a

hobby in 1889

Python is a General-purpose interactive and powerful programming Language

It is also a high-level Programming language.

this programming language is also an Open-Source

Python is a very popular programming language, this programming is a large amount

os use in Desktop.

web Application, game Development...many more filed uses it, and nowadays this

programming language

are very demand and top programming languages, Because these programming languages 

is basically use in 

Scientific and Numeric value find out, in this programming Languages a large amount

of the library also available

and every library is very useful for human beings.



2.What is Feature of Python..?

Ans-1.Simple and Easy to Learn 

      2.Interpreted Language

      3. Free and Open Source

      4.Large Standard Library

      5.Object-Oriented Language

      6. DMA

      7.Integrated...and many more

3.What is the Application of Python..?

Ans-1.What is the use of Python...with example..?

Python is a very large area like

              (i) GUI Application

              (ii)Web Application

(iii)Data Analysis

(iv) Machine Learning

(v) Raspberry Pi

(vi)Game Development

             (vi)Software Development

             (vii)system Administration

(i) GUI Application-In python also graphics available to used for GUI apps all the time in python famous library like-PyQt, Tkinter, PyGObject, Pyside,kivy, WxPython, etc.

(ii)Web Application-We can use Python to create web applications, There are many python best framework like Django, Bottle, Torrando, Flask web2py, etc

(iii)Data Analysis-

   Python is the lead language of choice for a Data scientist, it is a very popular carrier filed in the future .its an excellent library like NumPy, Pandas, Scipy.

(iv) Machine Learning-In machine learning is about making a prediction with data.it is very highly used in face recognition, music recommendation, and Breast cancer. These excellent libraries in Python like SciKit-Learn, Tensorflow, etc.

(v) Raspberry Pi-

     What is Raspberry Pi..?

    Definition-The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or

    TV, and uses a standard keyboard and mouse.

    It can do almost everything a normal desktop can do 

 We can build the Home Automation System and even robots 

   using Raspberry-PiThe coding on a Raspberry Pi can be performed  

   using Python

4.Difference Between Machine Code And ByteCode..?

Ans-Machine Code(aka native code)-Machine code is a set of instructions that directly gets executed by the CPU. 

Almost all the high-level languages such as C, C++ translate the source code into executable machine code with the help of Compilers

This Machine code is then directly executed by the underlying Machine ( OS+CPU)

Bytecode-Bytecode is an intermediate code but it is different than machine code because it cannot be directly executed by the CPU.

So whenever the compiler of a language that supports bytecode compiles a program, the compiler never generates machine code.

Rather it generates a machine-independent code called the “bytecode”.

5.Explain any two-way interacting with Python..?

Ans-1.Interactive Mode-In Interactive Mode, Python waits for us to enter a command.

When we type the command, the Python interpreter goes ahead and executes the command, and then it waits again for our next command.

In Script mode, the Python interpreter runs a program from the source file.

2.Script Mode-Python Shell is great for testing small chunks of code but there is one problem 

the statements we enter in the Python shell are not saved anywhere.

So if we want to execute the same set of statements multiple times we will have to write them multiple times which is a difficult task.

In this case, it is better to write the code in a File, Save it and then Run it This is called Script Mode

6.How many types of predefined function in python and explain it..?

Ans-Python has a very rich set of  predefined functions and they are broadly

categorized to be of 2 types

1.Built In Functions-Built in functions are those functions that are always available for use.

For example, print() is a built-in function which prints the given object to the standard output device (screen) 

As of version 3.6,  Python has 68 built-in functions and their list can be obtained on the following url : 

https://docs.python.org/3/library/functions.htm


2.Functions Defined In Modules-A Module in Python is a collection of functions and statements which 

provide some extra functionality as compared to built-in functions.

We can assume it just like a header file of the C/C++ language.

Python has 100s of built-in Modules like math, sys, platform, etc which prove to be very useful for a programmer

For example, the module math contains a function called factorial( ) which can calculate and return the factorial of any number.

But to use a module we must first import it in our code using the syntax :

import <name of the module>

For example import math

Then we can call any function of this module by prefixing it with the module name

For example math.factorial(5

7.How many types of Error in python and Explain it...?

Ans-1.Syntax Error-Syntaxes are RULES OF A LANGUAGE and when we break these rules, the error

7.which occurs is called Syntax Error.

Examples of Syntax Errors are:

(i) Misspelled keywords.

(ii) Incorrect use of an operator.

(iii) Omitting parentheses in a function call.

2.Runtime Error-As the name says, Runtime Errors are errors that occur while the program is running. 

As soon as the Python interpreter encounters them it halts the execution of the program and displays a message about the probable cause of the problem.

They usually occur when the interpreter counters an operation that is impossible to carry out and one such operation is dividing a number by 0. 

Since dividing a number by 0 is undefined, so, when the interpreter encounters this operation it raises ZeroDivisionError as follows:

8.What is the Identifier in python and what is the rule in python..?

Ans-What is an identifier?

The identifier is the name given to entities like class, functions, variables, modules, and any other object in Python.

->Rules for identifiers:-Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_)

                                No special character except underscore is allowed in the name of a variable

It must compulsorily begin with an underscore ( _ ) or a letter and not with a digit. Although after the first letter

we can have as many digits as we want. So 1a is invalid, while a1 or _a or _1 is a valid name for an identifier.

9.Wha is Reserved words and what is the rule in python..?

Ans-Reserved Word-A word in a programming language which has a fixed meaning and cannot be redefined by the programmer or used as identifiers

=>How many reserved words are there in Python?

Python contains 33 reserved words or keywords

The list is mentioned on the next slide

We can get this list by using help() in Python Shell

These 33 keywords are:

False, True, None, def,

del ,import ,return , 

and, or, not,

 if ,else ,elif ,

for, while, break, continue,

is, as, in,

global, nonlocal, yield,

 try, except, finally, raise, 

 lambda ,with ,assert ,

class, from, pass  

10.What are Data types in python..?

Ans-Although a programmer is not allowed to mention the data type while creating variables in his program in Python, but Python internally allows different data types to variables depending on their declaration style and values.

=>Overall Python has 14 data types and these are classified into 6 categories.

These categories are:

1.Numeric Types-int,float,comples.

2.Boolean Type-Bool.

3.Sequence Types-str,list,bytes,bytearray,tuples,range.

4.Set Types-set,frozenst.

5.Mapping Type-dict.

6.None Type-Nontype.

11.What is String Concatenation in python with example...?

Ans-Concatenation means joining two or more strings together 

To concatenate strings, we use the + operator. 

Keep in mind that when we work with numbers, + will be an operator for addition

but when used with strings it is a joining operator.

Example1:

s1=“Good”

s2=“Morning”

s3=s1+s2

print(s3)

Output:

    GoodMorning

Example:

s1=“Good”

s2=“Morning”

s3=s1+” “+s2

print(s3)

Output:

    Good Morning

12.What is variable and how to work in Python..?

Ans-A variable can be seen as a container to store certain values. 

While the program is running, variables are accessed and sometimes changed,

i.e. a new value will be assigned to a variable

=>Variable work in python-In Python when we assign value to a variable, then things are different than C. 

Suppose we write a=42 in Python, then Python will create 2 things:

An object in heap memory holding the value 42, and

A reference called a which will point to this object

Now if we create another variable called b and assign it the same value, then Python will do the following: Create a new reference by the name b

Assign the address of the previously created object to the reference b because the value is the same

So now both a and b are pointing to the same object

13.What is mutable and immutable and explain for example..?

the ans-A mutable object can change its state or contents and immutable objects cannot.

=>Mutable objects:-

list, dict, set, byte array

=>Immutable objects:-

int, float, complex, string, tuple, frozen set [note: an immutable version of the set], bytes

A practical example to find out the mutability of object types

x = 10

x = y

We are creating an object of type int. identifiers x and y points to the same object.

id(x) == id(y)

id(y) == id(10)

if we do a simple operation.

x = x + 1

Now

id(x) != id(y)

id(x) != id(10)

The object in which x was tagged is changed. object 10 was never modified. Immutable objects doesn’t allow modification after creation

In the case of mutable objects

m = list([1, 2, 3])

n = m

We are creating an object of type list. identifiers m and m tagged to the same list object, which is a collection of 3 immutable int objects.

id(m) == id(n)

Now poping an item from list object does change the object,

m.pop()

object id will not be changed

id(m) == id(n)

m and n will be pointing to the same list object after the modification. The list object will now contain [1, 2].

14.what is comment and how many types of comment in python explain it..?

Ans-Comments are statements in our program which are ignored by the compiler or interpreter i.e they are not executed by the language

We generally create comments to let developers understand our code’s logic.

This is a necessary practice, and good developers make heavy use of the comment system. 

Without it, things can get confusing

Python provides 2 types of comments:-

1.Single Line Comment ( official way of the comment)-Single-line comments are created simply by 

beginning a line with the hash (#) character, and they are automatically terminated by the end of the line.

For example:

a=10

     #a=a+1

print(a)

Output:

10


2.MultiLine Comment ( un offcial way)-If  we want to simplify our efforts for writing Multi Line Comments 

then we can wrap these comments inside triple quotes ( double or single ) as shown below

For example:

a=10

     ' ' ' a=a+1

           a=a+1  ' ' '

print(a)

Output:

10

15.What is the operator and how many types of operatorExplain in Details..?

Ans-Python provides us 7 types of operators:

1.Arithmetic Operators-In Python , we have 7 arithmetic operators and they are as below:

        + 

-  

*  

%

// 

    ** 

2.Relational or Comparison Operators-Relational operators are used to compare values. 

They either return True or False according to the condition.

like->,<,>=,<=,==,!=


3.Logical Operators-

Logical operators are used to combining two or more conditions and perform the logical 

operations using Logical and, Logical or and Logical not. 

Like-and, or, not

4.Assignment Operator-=

+= Add AND

-= Subtract AND

*= Multiply AND

/= Divide AND

%= Modulus AND

**= Exponent AND

//= Floor Division


5.Bitwise Operators-

&

|

 ^

<<

>>



6.Identity Operators-

is

is not

7.Membership Operators-

in

not in

16.How many types of Decision Control Statements..?

Ans-Decision Control Statements in Python are those statements which decide the execution flow of our program.

In other words, they allow us to decide whether a particular part of our program should run or not based on certain conditions.

The 4 decision control statements in Python are:

if

if….else

if…elif…else

nested if

17.How many types of Iterative Statements..?

Ans-Iterative Statements

Types of loop supported by Python

The while loop

The while-else loop

The break, continue and pass  Statement

18.What is the output?

i=0

while i<4:

i=i+1

if(i%2!=0):

pass

print("hi",end=" ")

else:

print(i,end=" ")


A.hi 2 hi 4

B.Syntax Error

C.2 4

D.Infinite loop

Correct Answer: A


19.1What is the output ?

x = "abcdef" 

i = "i" 

while i in x: 

print(i, end=" ")

A.a b c d e f

B.i i i i i i 

C.Error

D.No output

Correct Answer: D

19.2What is the output?

i = 2 

while True: 

if i%3 == 0: 

break 

print(i,end=“ “) 

i += 2

A.Infinite loop2 4

B.2 3

C.None of the above

Correct Answer: B

20.What is range function with example..?

Ans-The range() function is an in-built function in Python, and it returns a range object.

This function is very useful to generate a sequence of numbers in the form of a List.

The range( ) function takes 1 to 3 arguments  

=>Syntax:

range(n)

For an argument n, the function returns a range object containing integer values from 0 to n-1.

Example:

a=range(10)

print(a)

Output:range(0,10)

21.What is a function in python..?

Ans-A function is a block of code that only runs when it is called.

You can pass data, known as parameters, into a function.

A function can return data as a result.

Creating a Function

In Python a function is defined using the def keyword:

Example-

def my_function():

  print("Hello from a function")

22.wha is difference parameter and argument..?

Ans-The terms parameter and argument can be used for the same thing: information that are passed into a function

 A parameter is the variable listed inside the parentheses in the function definition. An argument is a value that is sent to the function when it is called.

argument. A value passed to a function (or method) when calling the function. There are two types of arguments:

keyword argument: an argument preceded by an identifier (e.g. name= ) 

in a function call or passed as a value in a dictionary preceded

23.How many Types of argument in python..?

Ans-In Python, a function can have 4 types of arguments:

1.Positional Argument

2.Keyword Argument

3.Default Argument

4.Variable Length Argument

24.What Is Call By Object Reference..?

Ans-It's different if we pass mutable arguments.

They are also passed by object reference, but they can be changed in place in the function.

If we pass a list to a function, elements of that list can be changed in place, i.e. the list will be changed even in the caller's scope. 

Example-def show(a):

print("Inside show , a is",a," It's id is",id(a))

a=10

print("Outside show, a is",a," It's id is",id(a))

show(a)

25.What Are Anonymous Functions ..?

Ans-An anonymous function is a function that is defined without a name.

While normal functions are defined using the def keyword, we define anonymous functions using the lambda keyword.

Hence, anonymous functions are also called lambda 

Syntax:

lambda [arg1,arg2,..]:[expression]

lambda is a keyword/operator and can have any number of arguments.

But it can have only one expression. 

Python evaluates the expression and returns the result automatically.

26.What Is An Expression in python..?

The ans-An expression here is anything that can return some value.

The following items qualify as expressions.

Arithmetic operations like a+b and a**b

Function calls like sum(a,b)

A print statement like print(“Hello”)

27.What Is map( ) Function..?

Ans-As we have mentioned earlier, the advantage of the lambda operator can be seen when it is used in combination with the map() function.

map() is a function which takes two arguments:

r = map(func, iterable)

The first argument function is the name of a function and the second argument, iterable, should be a sequence (e.g. a list tuple, string, etc) or anything that can be used with for loop. 

map() applies the function to all the elements of the sequence iterable

To understand this, let’s solve a problem.

Suppose we want to define a function called square( ) that can accept a number as an argument and returns it’s square.

The definition of this function would be :

Example-

def square(num):

return num**2

28.write an example of map() function..?

Ans-def square(num):

return num**2


mynums=[1,2,3,4,5]

for x in mynums:

print(square(x)) 

Output:

1

4

9

16

25

29.What Is filter( ) Function..?

Ans-To understands this, let’s solve a problem.

Suppose we want to define a function called   check_even( ) that can accept a number as an argument 

and return True if it is even, otherwise, it should return False

The definition of this function would be :

def check_even(num):

return num%2==0

Now suppose we have a list of numbers and we want to extract only even numbers from this list

mynums=[1,2,3,4,5,6]

One way to do this , will be to use a for loop 

mynums=[1,2,3,4,5,6]

for x in mynums:

if check_even(x):

print(x)

Example-def check_even(num):

return num%2==0

mynums=[1,2,3,4,5,6]

for x in mynums:

if check_even(x):

print(x)

Output:

2

4

6

30.What is the list explains in detail..?

Ans-Unlike C++ or Java, Python doesn’t have arrays. 

So, to hold a sequence of values, Python provides us a special built-in class called ‘list’. 

Thus a list in Python is defined as a collection of values.

=>The important characteristics of Python lists are as follows:

Lists are ordered.

Lists can contain any arbitrary objects.

List elements can be accessed by index.

Lists can be nested to arbitrary depth.

Lists are mutable.

Lists are dynamic.

In Python, a list is created by placing all the items (elements) inside a square bracket [ ], separated by commas.

It can contain heterogeneous elements also.

# empty list 

my_list = [] 

# list of integers 

my_list = [1, 2, 3] 

# list with mixed datatypes 

my_list = [1, "Hello", 3.4]

31.How many types of built-in function in the list..?

Ans-There are some built-in functions in Python that we can use on lists.

These are:

1.len()

2.max()

3.min()

4.sum()

5.sorted()

6.list()

7.any()

8.all()

32.How many types of list method in python..?

Ans-There are some methods also in  Python that we can use on lists.

=>These are:

1.append()

2.extend()

3.insert()

4.index()

5.count()

6.remove()

7.pop()

8.clear()

9.sort()

10.reverse()

33.What is comprehension in python..?

Ans-Comprehensions are constructs that allow sequences to be built from other sequences. 

In simple words to build a List from another List or Set from another Set, we can use Comprehensions

Python 2.0 introduced list comprehensions and Python 3.0 comes with a dictionary and set comprehensions.

To understand List comprehensions let’s take a programming challenge.

Suppose you want to take the letters in the word “Bhopal”, and put them in a list.

Can you tell me how many ways can you do this?

Till now, we know 2 ways to achieve this:

1.Using for loop

2.Using lambda

34.What is Tuple explain in detail..?

Ans-Python provides another type that is an ordered collection of objects.

This type is called a tuple.

Program execution is faster when manipulating a tuple than it is for the equivalent list. 

They prevent accidental modification.

There is another Python data type called a dictionary, which requires as one of its components a 

value that is of an immutable type. A tuple can be used for this purpose, whereas a list can’t be.

As mentioned before a tuple is created by placing all the items (elements) inside a parenthesis (  ), separated by commas.

It can contain heterogeneous elements also.

# empty tuple

my_tuple = ()

# tuple having integers

my_tuple = (1, 2, 3)

# tuple with mixed datatypes

my_tuple = (1, "Hello", 3.4)

Example-

my_tuple = (2)

print(my_tuple)

print(type(my_tuple))

Output:

2

<class 'int'>

35.How many types of Built-In Functions For Tuple..?

Ans-A lot of functions that work on lists work on tuples too. 

But only those functions work with tuple which does not modify it

Can you figure out which of these functions will work with tuple?

1.len()

2.max()

3.min()

4.sum()

5.sorted()

6.tuple()

7.any()

8.all()

Example-

Returns the number of items in the tuple

Example:

fruits=("apple","banana","orange",None)

print(len(fruits)) 

Output:

4

36.How many types of method in python..?

ans-As mentioned previously a Tuple is immutable.

So only those methods work with it which do not change the tuple data

Can you figure out which of these methods work with tuples?

These are:

1.append()

2.extend()

2.insert()

4.index()

5.count()

6.remove()

7.pop()

8.clear()

9.sort()

10.reverse()

37.What is string..?

Ans-A Python string is a sequence of zero or more characters.

It is an immutable data structure. 

This means that we although we can access the internal data elements of a string object we can not change its contents

Python provides us 3 ways to create string objects:

1.By enclosing text in single quotes

2.By enclosing text in double quotes

3.By enclosing text in triple quotes (generally used for multiline strings)

Example-my_string = 'Hello'

print(my_string)

my_string = "Hello"

print(my_string)

my_string = '''Hello'''

print(my_string)

my_string = """Hello, welcome to

           the world of Python"""

print(my_string)

Output:

Hello

Hello

Hello

Hello, welcome to the python world

Python provides us 3 ways to access string objects:

1.Directly passing it to the print( ) function

2.Accessing individual elements using subscript operator [ ]

3.Accessing multiple elements using the slice operator [: ]

Example-

city="Mumbai"

print(city)

Output:

Mumbai

38.What is the string method..?

Ans-A string object has a number of methods or member functions. 

These can be grouped into different categories.

These categories are:

1.String conversion methods

2.String comparison methods

3.String searching methods

4.String replace methods

39.What is a dictionary in python explains in Details..?

Ans-Python dictionary is an unordered collection of items.

The collections we have studied till now like list, tuple, and string are all ordered collections as

 well as can hold only one value as their element 

On the other hand, the dictionary is an unordered collection that holds the data in a key: value pair.

Sometimes we need to store the data so that one piece of information is connected to another piece of information.

For example RolloStudent Name or           Customer NameMobile Number

In these examples, RollNo will be called a key while it’s associated Student Name will be called value

To store such paired data Python provides us the data type called dictionary

Creating a dictionary is as simple as placing items inside curly braces { } separated by a comma.

Every item has a key and the corresponding value expressed as a pair, key: value.

While values can be of any data type and can repeat, but keys must be of an immutable type and must be unique

Syntax:

d = { 

<key>: <value>, 

<key>: <value>, 

                <key>: <value> 

   }

# empty dictionary 

my_dict = { } 

# dictionary with integer keys 

my_dict = {1: 'Amit', 2: 'Brajesh',3:'Chetan'}

# dictionary with mixed keys 

my_dict = {1: 'John', 'a':'vowel'} 

# dictionary with list as values

my_dict = {'Rahul':['C', 'C++'], 'Ajay':['Java', 'C', 'Python'], 'Neeraj':['Oracle', 'Python']}

The important characteristics of Python dictionaries are as follows:

They can be nested.

They are mutable.

They are dynamic. 

They are unordered.

Unlike Lists and tuples, a dictionary item is accessed by its corresponding key not index

40.What are python modules, Name some commonly used built-in modules in Python?

Ans: Python modules are files containing Python code. This code can either be function classes or variables. A Python module is a .py file containing executable code.


Some of the commonly used built-in modules are:

->os

->sys

->math

->random

->data time

->JSON

41.Explain Inheritance in Python with an example..?

Ans: Inheritance allows One class to gain all the members(say attributes and methods)

 of another class. Inheritance provides code reusability, makes it easier to create and maintain an application.

 The class from which we are inheriting is called super-class and the class that is inherited is called a derived / child class.

They are different types of inheritance supported by Python:

1.Single Inheritance – where a derived class acquires the members of a single superclass.

2.Multi-level inheritance – a derived class d1 in inherited from base class base1, and d2 are inherited from base2.

3.Hierarchical inheritance – from one base class you can inherit any number of child classes

4.Multiple inheritance – a derived class is inherited from more than one base class.

42.Does python makes use of access specifiers..?

Ans: Python does not deprive access to an instance variable or function. Python lays down the concept 

of prefixing the name of the variable, function, or method with a single or

 double underscore to imitate the behavior of protected and private access specifiers.  

43.What is Polymorphism in Python..?

Ans: Polymorphism means the ability to take multiple forms. So, for instance, if the parent class has a method named ABC then the child class also can have a

 method with the same name ABC having its own parameters and variables. Python allows polymorphism.

44.Write code to print everything in the string except the spaces.

for I in s:

if i==' ': continue

print(i,end='')

Output-

IlovePython

45. What is the Python decorator..?

Decorators are very powerful and a useful tool in Python that allows the programmers to modify the behavior of any class or function. It allows us to wrap another function to extend the behavior of the wrapped function, without permanently modifying it.

# Decorator example  

def decoratorfun():  

    return another_fun  

=>Functions vs. Decorators-

A function is a block of code that performs a specific task whereas a decorator is a function that modifies other functions.

46.What is pickling and unpickling in Python..?

The Python pickle is defined as a module that accepts any Python

object and converts it into a string representation. It-dumps the Python object into a file using the dump function; this process is called pickling.

The process of retrieving the original Python objects from the stored 

the string representation is called as Unpickling.

47.What is lambda function in Python..?

The anonymous function in python is a function that is defined without a name. 

The normal functions are defined using the keyword "def", whereas, the anonymous functions are defined using the lambda function. The anonymous functions are also called as lambda functions.

48.List the features of Django?

Ans:

1.Excellent documentation

2.Python web framework

3.SEO optimized

4.High scalability

5.Versatile in nature

6.Offers high security

7.Thoroughly tested

8.Provides rapid Development

49.What is Django?

Django is a free and open-source web application framework written in Python. A framework is nothing more than a

 collection of modules that make development easier. They are grouped together and allow you to create applications or websites from an existing source, instead of from scratch.

This is how websites – even simple ones designed by a single person – can still include advanced functionality

like authentication support, management and admin panels, contact forms, comment boxes, file upload support,

and more. In other words, if you were creating a website from scratch you would need to develop these components yourself. By using a framework instead, these components are already built, you just need to configure them properly to match your site.

The official project site describes Django as “a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of

Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.”

Django offers a big collection of modules that you can use in your own projects. Primarily, frameworks

exist to save developers a lot of wasted time and headaches and Django is no different.

50.What is Flask?

Flask is a web framework that provides libraries to build lightweight web applications in python. It is developed by Armin Ronacher who leads an international group of Python enthusiasts (POCCO). It is based on the WSGI

toolkit and jinja2 template engine. Flask is considered as a micro framework


Thank you...



Comments

Post a Comment

Popular posts from this blog

How to Send OTP in Mobile Number | login with OTP mobile Number | How to send OTP in mobile no with Spring Boot APP

   ðŸ˜‚               Login with Mobile Number OTP ---------------------------------------------------------------------------- If you want to develop a project to log in with OTP mobile Number in Spring Boot Applications then this post for you. In this post, I am going to use some other service to send the OTP in mobile number. we have to use it in this project spring boot. we are going to use Twilio to send SMS. we are going to use a web socket to send the data from the browser to the SMS gateway. Oracle Database for store the user details. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> <version>2.3.3.RELEASE</version> </dependency> <dependency> <groupId>com.twilio.sdk</grou

Spring Boot With MySQL Database connection with Examples | MySQl Database Configuration with Spring Boot Projects

 ðŸ˜ƒ MySQL Database Configuration with Spring Boot Projects  In this article, we are going to introduce How to connect MySQL Database with the Spring Boot project. pom.xml   <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.projectlombok</gro

How can we create Auto generated field or ID for mongodb using spring boot

😂 How can we create an Auto-generated field or ID for MongoDB using spring boot? First Create One Application Like Mongodb_sequence-id-generator Pom.XML <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency> <dependency> <groupId>de.flapdoodle.embed</groupId> <artifactId>de.flapdoodle.embed.mongo</artifactId> </dependency> User.java package com.app; import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Transient; import org.springframework.data.mongodb.core.mapping.Document; @Document(collection = "users_db") public class User { @Transient public static final String SEQUENCE_NAME = &