Directory structure: βββ stellarcompiler-public-repo.git/ βββ CalculatorP.py βββ date_time.py βββ Dictionary.ipynb βββ intro.txt βββ string_test.py
Files Content:
op=["Add (+)","Subtract (-)","Division (/)","Multiply ()"] i=0 x=eval(input("input1 :")) y=eval(input("input2 :")) print("Select the operator") for i in range(len(op)): print (op[i]) ch="" ch=input("Operator :") print("Selected operation :" ,ch) if (ch=="+"or ch=="add"or ch=="Add"): sum=x+y print("Total sum :",sum) elif (ch=="-"or ch=="Sub"or ch=="sub"or ch=="Subtract"or ch=="subtract"): diff=x-y print("Difference :",diff) elif (ch=="/"or ch=="Div"or ch=="div"or ch=="Division"or ch=="division"): div=x//y rem=x%y print("Quotient :",div) print("Remainder :",rem) elif (ch=="" or ch=="mul" or ch=="Mul"): m=x*y print("Multiplied :",m) else: print("ERROR 400 BAD REQUEST")
import datetime as dt date= dt.date.today() print(date.day ,"/" ,date.month, "/", date.year) print("October","", date.day,"",date.year)
time=dt.time(10,30,55,4565) print(time)
"""
"""
set1={"apple","kiwi","Cherry","Durian"}
print(set1)
for i in set1: print(i)
"""
"""
set2={5,3,8,2,1,5,10,8,9,10}
print(set2)
for i in set2: print(i)
"""
"""
"""
"""
"""
"""
book={"Title":"ATOMIC HABITS","Author":"James Clear","Year":"2018"} print(book["Title"]) print(book["Author"]) print(book["Year"])
"""
"""
student_01={"First name":"Arthur","Last name":"Morgan","Roll No":"01","Class":"C1SB"}
print("Name :",student_01["First name"]+" "+student_01["Last name"])
print("Roll Number :",student_01["Roll No"])
print("Class :",student_01["Class"]) print("\n")
for key in student_01: print(key,":",student_01[key])
"""
"""
user={'name': 'Alice', 'age': 25}
user['city']='Ernakulam'
print(user)
"""
"""
user = {'name': 'Alice', 'age': 25}
user.update({'age':30,'city': 'New York'})
print(user)
"""
"""
user= {'name': 'Alice', 'age': 25}
print(user.get('name'))
print(user.get('city','Not Found'))
"""
"""
user= {'name': 'Alice', 'age': 25,'city':'Ernakulam'}
print(user.pop('city'))
print(user)
"""
"""
user= {'name': 'Alice', 'age': 25,'city':'Ernakulam'}
print(user.popitem()) print(user)
"""
"""
user= {'name': 'Alice', 'age': 25,'city':'Ernakulam'} del user['city'] print(user)
"""
"""
user= {'name': 'Alice', 'age': 25,'city':'Ernakulam'}
user_copy=user.copy() print(user_copy)
"""
"""
user= {'name': 'Alice', 'age': 25} print(user.items())
"""
We can check if a key is present inside a dictionary using 'IN' keyword - which returns a boolean ('T' or 'F')
"""
user= {'name': 'Dhishu', 'age': 25} print('name' in user) print('city' in user)
"""
"""
user= {'name': 'Aurora', 'age': 25,'city':"Ernakulam"}
for key in user: print(key,":",user[key])
"""
###inside a dictionary - we can write another dictionary as a "value" Example code π """
Students={'stud1':{'name':'Abel','Roll no':1},'stud2':{'name':'Abhiram','Roll no':2} }
print(Students) print(Students['stud1']) print(Students['stud1']['name'])
Welcome to git and github
(i). Git and Github are version control system that can track Changes to a file and control the file dynamics
(ii). Git and Github and separate systems -
Git is a local version control systems
Github is a cloud based version control system
HOW TO USE GIT AND GITHUB:
Step 1: Git Configuration > Install Git and create a github User profile > Enter to command prompt and Configure Git by [git config --global user.name "github username" git config --global user.mail "Enter the email used for Github"] > Check the status of git by [git config --list] > Exit and go to your local repository(Desired folder), and open a terminal on that folder. > Open Visual Studio Code (VS CODE) by ["code ."] > Initialise Git in terminal [git init] > Open a file [.txt, .py, .js, etc....]
End of Step 1
Step 2: Adding and Commiting > Type in terminal : git add . (for adding a group of files) or git add > After "add" command the files go for staging > For checking the staging : type git status > Type git commit -m "Type any message" for commiting it into the local repository > type git log for the commit status and Commit "Hash" > Now the file is stored in the local repository
End of Step 2
Step 3: Pushing the file to Github > Type git remote add origin <"The github repo url"> for acknowledge the git about cloud repo > Type git remote -v for init status > Type git push origin for uploading > Check on github repo for file updation
ch="" str1="" ch=input("Enter any string :\n") str1=input("Enter any string :\n")
out1=ch.upper() out2=ch.lower() str2=ch+" "+str1 print("Extract substring") x=int(input("From :")) y=int(input("To :")) char=ch[x:(y+1)]
print("Uppercase :",out1) print("Lowercase :",out2) print("Concatenation Operation :",str2) print("Extracted Substring :",char)