
Indexing means fetching the specific character object
Slicing means access the range of characters
Different types of sequences in python are strings, Unicode strings, lists, tuples, buffers, and xrange objects
Slicing & indexing operations are salient features of sequence.
indexing operation allows to access a particular item in the sequence directly ( similar to the array/list indexing) and the slicing operation allows to retrieve a part of the sequence.
The slicing operation is used by specifying the name of the sequence followed by an optional pair of numbers separated by a colon within square brackets say S[startno.:stopno].
The startno in the slicing operation indicates the position from where the slice starts and the stopno indicates where the slice will stop at.
If the startno is ommited, Python will start at the beginning of the sequence. If the stopno is ommited, Python will stop at the end of the sequence..
Following code will further explain indexing & slicing operation:
>>> cosmeticList =[‘lipsstick’,’facepowder’,eyeliner’,’blusher’,kajal’]
>>> print “Slicing operation :â€,cosmeticList[2:]
Slicing operation :[‘eyeliner’,’blusher’,kajal’]
>>>print “Indexing operation :â€,cosmeticList[0]
“Indexing operation :lipsstick
Django supports the following database backends:
1. PostgreSQL
2. MySQL
3. SQLite
4. Oracle
5. MariaDB
Additionally, there are third-party backends for other databases like Microsoft SQL Server and others.
To test a Python program or component, you can use the built-in `unittest` framework or third-party libraries like `pytest`. Write test cases in a separate file, define test functions or classes, and use assertions to check expected outcomes. Run the tests using the command line or an integrated development environment (IDE) that supports testing.
<form> - tag is used for sending data from the client
browser to the server.
There is no way for submitting a page if there is no
<form> - tag in the page.
form is usefully for posting the data from one page to another
.and this done by tow way either submitting the form by
submit button or through javascript function.
JavaScript can run on both client-side and server-side.
client side
javascript is run on client side.doing client side validation.
1. **Performance**: Stored procedures are precompiled, which can lead to faster execution.
2. **Reusability**: They can be reused across multiple applications, reducing code duplication.
3. **Security**: They provide a layer of security by restricting direct access to the underlying tables.
4. **Maintainability**: Changes can be made in one place without affecting the application code.
5. **Reduced Network Traffic**: They can execute multiple SQL statements in a single call, minimizing data transfer.
6. **Transaction Control**: They allow for better management of transactions and error handling.