Python for Engineers

Solve Problems by Coding Solutions - A Complete solution for python programming

Blog Pages

▼

Creating a dictionary and traversing

›
d={10: 'iprg' , 22: 'Nan', 33:'Kool',8: 'Jool' } # Creating a dictionary with key: value pair for i in d: ...

Tuples Manipulation

›
try:       l=['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturd...

Creation and accessing values in Tuples

›
t=(22,33,44,55,66,77,88,99) #A tuple is a sequence of immutable Python print 'Tuple elements : ',t #Accessing Values in Tuples pr...

Different indexing in string

›
fruit='apples' l=len(fruit) print 'Length of string:',l print  fruit[0:4]    #[m:n]  m is starting index and n will upto ...

Compare the two string based on ascii values

›
str1=raw_input('Enter the string 1:  ') str2=raw_input('Enter the string 2:  ') if str1==str2:       print 'String ar...
‹
›
Home
View web version
Powered by Blogger.