How to write a program to accepts a string from console and print the characters that have even indexes?

Example:

If the following string is given as input to the program:
H1e2l3l4o5
Then, the output of the program should be:
Hello

print("Please enter text to print::")
inputchars = input()

if inputchars:
	string = ""
	for i in inputchars:
		if inputchars.index(i)%2 == 0:
			string += str(i)
	
	print('-------------------')
	print("You Entered:", inputchars)
	print("Result:")
	print(string)
# OUTPUT::
Please enter text to print::
H1e2l3l4o5
-------------------
You Entered: H1e2l3l4o5
Result:
Hello

How to find the odd and even numbers using Python?

Here, In below code, user can enter two numbers to find the odd and even numbers between them. The number must be in between 1000 and 3000.

print("Please Enter the Number between 1000 and 3000")

print("Enter the First Number:")
first_number = input()

print("Enter the Second Number:")
second_number = input()

print("First Number: ", first_number)
print("Second Number: ", second_number)


if int(first_number) >= 1000 and int(second_number) <= 3000:
	first_number = int(first_number)
	second_number = int(second_number)

	even_numbers= []
	odd_numbers = []

	for i in range(first_number,(second_number+1)):
		if i%2 is 0:
			even_numbers.append(str(i))
		else: 
			odd_numbers.append(str(i))
	
else:
	print("Please enter a number between 1000 and 3000")

How to change a database table prefix in PhpMyAdmin?

Here, to Change the database table prefix from previous to new one, OR add table_prefix to the tables.

How to change e database table prefix:

  1. First Log In to PhpMyAdmin.
  2. Now, Select the Database want to change.
  3. Click on the Structure and here all tables are listed.
  4. Now, in the bottom position, mark check all or Select the tables want to update or modify.
  5. A Modal will Pop Up, here fill the fields.
  6. In Modal: From : Enter Old table prefix
  7. In Modal: To: Enter new table prefix
  8. In Modal: Click Continue.
  9. Now all done. Check your tables.

How to Make a Query in CakePHP?

CakePHP

To Query from Table in CakePHP we can use the below code. We can also Query like ORDER_BY, Select Table FIELDS etc.

# Find Order from Order Table in CakePHP

$this->Order->find('all', array(
   'recursive' => -1,
   'conditions'=>array( 'Order.id'=>1 ),
   'fields' => array( 'Order.date', 'Order.id', 'Order.total'),
   'order' => array('Order.date' => 'DESC'),
));


# For Order By filter in Querry, we can use.

   'order' => array('Order.date' => 'DESC'),
or,
   'order' => array('Order.date DESC'),
or,
   'order' => 'Order.date ASC',