تم النشر منذ 31 Mar 2014 word = "Hello World" print word.count('l') # count how many times l is in the string print word.find("H") # find the word H in the string print word.index("World") # find the letters World in the string print word[0] #get one char of the word print word[0:1] #get one char of the word (same as above) print word[0:3] #get the first three char print word[:3] #get the first three char print word[-3:] #get the last three char print word[3:] #get all but the three first char print word[:-3] #get all but the three last character print word[:] # a copy of the whole list print "."* 10 # prints ten dots print word.split(' ') # Split on whitespace print word.replace("Hello", "Goodbye") print word.startswith("H") print word.endswith("d") print word.endswith("w") print word.upper() print word.lower() print word.title() print word.capitalize() print word.swapcase() print ":".join(word) # #add a : between every char print " ".join(word) # add a whitespace between every char print word.isalnum() #check if all char are numbers print word.isalpha() #check if all char in the string are alphabetic print word.isdigit() #test if string contains digits print word.istitle() #test if string contains title words print word.isupper() #test if string contains upper case print word.islower() #test if string contains lower case print word.isspace() #test if string contains spaces print word.endswith('d') #test if string endswith a d print word.startswith('H') #test if string startswith H s = " Hello " print s print s.strip() #removes from both ends print s.lstrip() #removes leading characters (Left-strip) print s.rstrip() #removes trailing characters (Right-strip) 1 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
0 قام بالرد منذ 31 Mar 2014 (معدل) fname = "belal" lname = "syrian" age = 18 print "%s %s is %d years "%(fname, lname, age) ''' %s # used for strings %d # used for numbers %f # used for floating point ''' print "{} {} is {} years ".format(fname, lname, age) تم تعديل 31 Mar 2014 بواسطه the.scorpion 1 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
0 قام بالرد منذ 31 Mar 2014 عمل رائع أخي قكرة جميلة أن تقوم بشرح الدوال شكرا لك علي إثراء هذا القسم و أرجو منك أن لا تتوقف إن رأيك أنك الناشط الوحيد فلكل مشاغله و كلما تفرغ أحد الاعضاء سعى جاهدا لإثراء هذا الموقع الرائع معا نرسم أحرف النجاح 0 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
0 قام بالرد منذ 31 Mar 2014 شكرا على مرورك اخيساحاول ان اقدم كل ما استطيع وكما قلت معا نرسم أحرف النجاح 0 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
0 قام بالرد منذ 1 Apr 2014 بارك الله فيك أخي على الشرح لماذا لا تقوم بالقيام ببرمجه برنامج كامل ويكون عباره على مشروع وتقوم من خلاله بشرح اللغه - برنامج موظفين- برنامج مخزونوغيرها من البرامج 0 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
0 قام بالرد منذ 2 Apr 2014 (معدل) لماذا لا تقوم بالقيام ببرمجه برنامج كامل ويكون عباره على مشروع وتقوم من خلاله بشرح اللغه اقترح مشروع و ساقدم ما استطيع واتمنى من الجميع المشاركة سواء مبتدئين او محترفين تم تعديل 2 Apr 2014 بواسطه the.scorpion 0 شارك هذا الرد رابط المشاركة شارك الرد من خلال المواقع ادناه
تم النشر منذ
word = "Hello World"
print word.count('l') # count how many times l is in the string
print word.find("H") # find the word H in the string
print word.index("World") # find the letters World in the string
print word[0] #get one char of the word
print word[0:1] #get one char of the word (same as above)
print word[0:3] #get the first three char
print word[:3] #get the first three char
print word[-3:] #get the last three char
print word[3:] #get all but the three first char
print word[:-3] #get all but the three last character
print word[:] # a copy of the whole list
print "."* 10 # prints ten dots
print word.split(' ') # Split on whitespace
print word.replace("Hello", "Goodbye")
print word.startswith("H")
print word.endswith("d")
print word.endswith("w")
print word.upper()
print word.lower()
print word.title()
print word.capitalize()
print word.swapcase()
print ":".join(word) # #add a : between every char
print " ".join(word) # add a whitespace between every char
print word.isalnum() #check if all char are numbers
print word.isalpha() #check if all char in the string are alphabetic
print word.isdigit() #test if string contains digits
print word.istitle() #test if string contains title words
print word.isupper() #test if string contains upper case
print word.islower() #test if string contains lower case
print word.isspace() #test if string contains spaces
print word.endswith('d') #test if string endswith a d
print word.startswith('H') #test if string startswith H
s = " Hello "
print s
print s.strip() #removes from both ends
print s.lstrip() #removes leading characters (Left-strip)
print s.rstrip() #removes trailing characters (Right-strip)
شارك هذا الرد
رابط المشاركة
شارك الرد من خلال المواقع ادناه