Posts

Showing posts from April, 2021

python

 functions  default parameter: def add(a,b=0):     c=a+b     return c x=add(3) print(x) in the above code, if no value for b is given, value of b becomes 0 by default json files import json x={"name":"samit, "age":20,"job":"eng"} y=json.dumps(x)               #converts dictionary to json print(y)

git commands

git git config list: view all items of list git config user.name: view username git config user.email: view username git config --global user.name "username": "username" git config --global user.email "email": "email" git init : initialize git and starts tracking git  status: views current status of git  git add --a: add all of items for staging git add first.txt: add only first.txt for staging git commit -m "message": commits with given msg git log: shows logs of all commits made  rm -rf .git: deletes .git folder, wont be git repository anymore git clone url: creates the directory and pull all the content of it locally