Search results
Create the page "Python Functions" on this wiki! See also the search results found.
- ...n search 'Recursion' on YouTube and try to understand recursive functions. Python code: Or [python]def f(n):4 KB (633 words) - 21:31, 6 October 2024
- ...can be delimited by double or single quotes (<tt>'this is also a string in Python'</tt>). ...t>. To convert between strings and numbers in Python use [[type conversion functions]].4 KB (622 words) - 00:24, 8 April 2011
- This page is intended to serve as a brief, beginners reference to the [[Python]] programming language. In Python, there is no need to specify a type when storing information in a variable.28 KB (4,762 words) - 20:20, 12 June 2023
- *For the purposes of this class, numbers in [[Python]] are either [[integer]]s or [[floating point number]]s. Unlike humans, wh *Text in Python is stored in a [[string]], and is delimited by either single quotes (<tt>'t4 KB (569 words) - 21:05, 15 August 2020
- '''Type conversion functions''' are used in programming to convert data to primitive [[datatype]]s. ==Type Conversion in [[Python]]==987 bytes (147 words) - 19:10, 19 April 2011
- In [[Python]], the '''print''' function prints things to the screen. In its simplest f ...rridden, see the [http://docs.python.org/py3k/library/functions.html#print Python 3.2 Documentation] for details.1 KB (200 words) - 18:58, 27 June 2011
- In [[Python]], the '''input''' function prompts the user for input. It has the followi ...ing point number]] it's necessary to use one of Python's [[type conversion functions]].666 bytes (106 words) - 14:39, 10 April 2011
- ...ring operations]], [[boolean#Boolean Operations|Boolean operations]] and [[python sequence types#Sequence Operations|Sequence operations]]. ...tt> both return <math>x^y</math>. As is common for programming languages, Python defines <tt>0**0</tt> to be 1, despite the fact that <math>0^0</math> is un3 KB (505 words) - 13:57, 6 May 2024
- ...g terminology, functions aren't used, they're '''called'''. If necessary, functions can take input in the form of '''parameters''', and '''return''' output. ..., and by abstracting away implementation details (for example, you can use Python's built-in square root function without needing to know how it's implemente4 KB (683 words) - 23:20, 29 October 2012
- '''Lists''' in [[Python]] are used to store multiple objects in a single ordered set. Unlike [[tup ...he list in most other programming languages is the [[array]], but lists in Python are more flexible, similar to the Vector class in [[Java]] or [[C++]].3 KB (470 words) - 11:27, 9 September 2021
- ...generic term for an ordered set. There are several types of sequences in Python, the following three are the most important. *<tt>mySeq[i]</tt> will return the i'th character of mySeq. Sequences in Python are '''zero-indexed''', so the first element has index 0, the second has in3 KB (443 words) - 15:53, 19 February 2024
- The '''range function''' in [[Python]] generates a sequence of [[integer]]s. It's most frequently used in for-l ...ou need a real [[list]] for some reason you can call the [[type conversion functions|type conversion function]] <tt>'''list'''</tt> on the range as shown below:3 KB (420 words) - 14:40, 10 April 2011
- ...module (Python)|module]]''' is used to generate pseudo-random numbers in [[Python]]. ==Useful Functions==1 KB (187 words) - 11:55, 30 June 2020
- ...few of them, so that would be very inefficient. Instead, Python organizes functions into '''modules''', which we can load as needed. ...re to import them from. This way, because we've explicitly identified the functions we want and where to find them, we don't need to preface them with the name3 KB (490 words) - 15:30, 10 April 2011
- ...and write '''files''' is important to nearly every type of program. In [[Python]] files are objects. ...to doesn't exist Python will create it for us. Note also that by default Python only looks for files in the same directory as your program - make sure anyt3 KB (483 words) - 23:24, 17 April 2011
- The '''open function''' in [[Python]] is used to open [[file]]s. Usually, filename will be a text file ending in <tt>.txt</tt>. By default Python only looks for files in the same directory as your program, so make sure an1 KB (207 words) - 21:27, 18 April 2011
- ...on supports [http://en.wikipedia.org/wiki/First_class_function first class functions].795 bytes (115 words) - 15:40, 19 April 2011
- '''Tuples''' in [[Python]] are used to store multiple items in a single ordered set. However, unlik ...ate a tuple with only one element you need a trailing comma, to signify to Python you want a tuple rather than just an expression in parentheses:1 KB (196 words) - 16:18, 19 April 2011
- In [[Python]] a '''dictionary''' is used to store a mapping from one set of objects to ...ed '''value'''. Then, to access the dictionary you can provide a key, and Python will "look up" and return the associated value. Values can be any type of3 KB (467 words) - 11:52, 20 February 2024
- ...what station it's tuned to and whether or not it's on. It would also have functions for the things we usually do with a radio - listening and changing settings ...for things, data associated with a class are called '''attributes''', and functions associated with a class are called '''methods'''.5 KB (755 words) - 22:04, 27 May 2013