Widgetized Section

Go to Admin » Appearance » Widgets » and move Gabfire Widget: Social into that MastheadOverlay zone

What are some key points I should know when studying python?

 1.Language is made up of letters, numbers, symbols, and other symbols. 2.These characters can put into a string 3.eval(mystring) returns a number that corresponds to the number of characters 4.range(number) iterates through a numeric sequence from one to the other What are some differences between Python 2 and Python 3? 1.Python 3 is more strict with converting nonstring objects to strings 2.Moved many of the unicode characters to graphemes 3.Killed hardcoded whitespace Why is it better to use Python 3 over Python 2? 1.Better way to convert nonstrings to strings 2.Don't need to use + to combine concatenate strings 3.Python 2 removes leading zeroes to make it work, Python 3 doesn't 4.Is forward compatible with many legacy scripts What are some best practices for working with lists in python? 1.Determine what type of data do you want it to be a.If you need every element to be of the same type, use list b.Else, use object 2. If you need to change an object in place, use list 3.If you need to make a fixedlength list, use list 4.If you need to make a listoflists, use list What is a tuple in python? A tuple is a sequence in Python in which you can also assign multiple objects, while lists are homogeneous cycles so they only allow the assignment of one object. How are tuples different from lists? Tuples are sequences in the Python coding language, while lists are arrays that are contiguous cycle whose elements are of one type. What are some other ways to define a list? programming.share.Don't define an empty list,include everything in brackets[] programming.share.Use list() to create a singleton list programming.share.Create a list with all the desired objects programming.share.Create a list with desired subtypes programming.share.Loop through every item in sequence What is the result of writing ab*3? Without a space between a and b, the minus has a binding power of a on the left and on the right, so ab*3 returns a tuple of (a, (b, (a*b))). What is the syntax for calling python? The general syntax for calling python is python.exe. what is the difference between using dots and commas to delimit loops? Commas are often easier to type.

You must be logged in to post a comment Login