Skip to main content

Learn Python

 

Python 


what is data type ?

 to declaring of a variable is called data type 
another words to declare the data what type of the data it is !

data types ?

Text Type:str
Numeric Types:intfloatcomplex
Sequence Types:listtuplerange
Mapping Type:dict
Set Types:setfrozenset
Boolean Type:bool
Binary Types:bytesbytearraymemoryview
None Type:NoneType

                                                  more


CODE FOR LIST SLICING:
------------
word=input('what is word?:')
print(word[1::2])
------
input: rhaajrui
output :HARI
---------------
where 1=index of word 
2= after second letter will be print at everytime

SECOND ONE 

word='rhaajrui'
print(word[1::2])

output:hari


CODE FOR REVERSING OF A STRING:
 ----------------
word=input('what is word?:')
print(word[::-1])
 
------
input: IRAH
output :HARI
---------------
CODE FOR  STRING FORMAT:
name='krishna'
age='18'
sex= 'male'

print(f'the age of {name} is {age} and he is {sex}')

OUTPUT:   the age of krishna is 18 and he is male

SECOND ONE 

 name='krishna'
age='18'
sex= 'male'
print(name ,age ,sex)
print(f'the age of {name} is {age} and he is {sex}')
print('the age of '+name+' is '+age+' and he is '+sex)

OUTPUT:
krishna 18 male
the age of krishna is 18 and he is male
the age of krishna is 18 and he is male
-------------------------



Comments

Popular posts from this blog

TCS PREPARATION

how to prepare last 7 days to tcs exam  7 days planner link PPT session recording  Learning resources for Cognitive Skills - Numeric, Reasoning & Verbal TCS NQT has reasonable weightage on Cognitive Skills - Numeric, Verbal and Reasoning.  We are sharing good resources which can be leveraged to build expertise in these areas. Suggesting dedicated one hour effort every day, spending around 20 minutes for each area.  Numerical Ability https://www.javatpoint.com/ aptitude/quantitative https://www.indiabix.com/ aptitude/questions-and- answers/   Reasoning Ability https://www.javatpoint.com/ reasoning https://www.indiabix.com/ logical-reasoning/questions- and-answers/ https://www.toppr.com/guides/ reasoning-ability/   Verbal Ability https://www.javatpoint.com/ verbal-ability https://www.indiabix.com/ verbal-ability/questions-and- answers/ TCS NQT Detailed Syllabus 2023 TCS NQT Syllabus 2023 TCS NQT has updated its TCS NQT Syllabus 2023  batches. They ha...

FORMAL LANGUAGE & AUTOMATA THEORY

FORMAL LANGUAGE & AUTOMATA THEORY   FLAT TEXT BOOK :   DOWNLOAD FLAT TEXT BOOK :   DOWNLOAD AUTOMATA THEORY TEXT BOOK :   DOWNLOAD AUTOMATA THEORY & APPLICATIONS TEXT BOOK :   DOWNLOAD FLAT DIGITAL NOTES PDF:   DOWNLOAD FLAT NOTES PDF :   DOWNLOAD FLAT FACULTY DATA PDF :   OPEN HERE