Skip to main content

Posts

Showing posts from July, 2022

Python Learning Part -1

Indexing and slicing with strings :  string = 'abcdefghijk' string[STARTING_INDEX_POSITION:GO_UPTO_INDEX_POSITION]  string[2:] //output cdefghijk string[:3] //output abc note-> it says goes upto the index d but not include the index d string[3:6] // output def String Concatenation : name = 'Amar'  lname = 'Singh' fname = name + lname // output Amar Singh Lost of string inbuild functions are there you can check and explore them like name.split() // ['Amar','Singh'] // split the string based on the white space Print Formatting with String : Format A string with .format() Input : print('my name is {}'.format('Dharmendra')) output : my name is Dharmendra Lists in Python: lists are ordered sequences which holds variety of object types. they use [] and , to separate it list support index & slicing   like [1,2,3,4,5] mylist = [1,2,3,4,5] mylist[1:] //[2,3,4,5] has some inbuild functions like .pop, .sort etc Dictionaries in Python ...

How To install and Use Anaconda for Python

 Download the sh file of anaconda from the below site. https://www.anaconda.com/products/distribution exceute the downloaded sh file  ssh Anaconda3-2022.05-Linux-x86_64.sh  and follow the steps, When done reopen the terminal and type anaconda-navigator (base) dharmendra@TTNPL-dharmendrasingh : ~ $ anaconda-navigator