Author: admin
python f string or python Formatted string literals
python f string is a new string formatting method in python, f string is much simpler and readable way of formatting strings in Python.The f-strings start with f prefix and use {} symbol to evaluate values.The python f-strings stands for python Formatted string literals.
Syntax print(f"{var} constant.")
# Python f string link = 'percentagetool.com' print(f"{link } is a simple online website for percentage calculations.") Out Put percentagetool.com is a simple online website for percentage calculations
# Python f-string link = 'tutorialshore.com' alexa=14999 print(f"{link} is a website with alexa rank {alexa}") Out Put tutorialshore.com is a website with alexa rank 14999
#using function in python f string def sum(x, y): return x + y p = 8 q = 4 print(f'sum of {p} and {q} is {sum(p, q)}') Out put sum of 8 and 4 is 12
git push remote permission to git denied to user with 403 error
When am trying to push files to git am getting an error ” git push remote permission to git denied to user with 403 error “.It is actually showing the wrong user name ,so first we need to change the git stored Credential user
so first step we need to find the stored Credential and delete it from the system
Check credential info
#git config credential.helper
Open Credential Manager form your system
Control Panel=> All Control Panel Items=>Credential Manager
Delete unwanted Credential
Again try to push the commited data
It will ask for your git username and password
Mysql query to fetch current month data
Sometimes we need to show only current month data in the application ,so for easy handling the data we should use a Mysql query to fetch current month data.Let we check out how to do that using one MySQL query
See below the Mysql query to fetch current month data
SELECT * FROM leads WHERE MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE()) // leads= Table Name // date = date field name
Here we are fetching current month data using the feature MONTH(CURRENT_DATE()) and MONTH(date)
MONTH(CURRENT_DATE()) will result 8 (since current month is Aug)
Next feature we are using in Mysql query to fetch current month data is YEAR(date) and YEAR(CURRENT_DATE())
YEAR(CURRENT_DATE()) will result 2019 (since today is Aug 24 2019)
so actual Mysql query to fetch current month data will work like this
SELECT *
FROM leads
WHERE MONTH(date) = 9
AND YEAR(date) = 2019
so it will fetch all result form database table leads that having date field value is in august month