Syntax Restrictions
In order to help you become a more proficient programmer and problem solver, there are some components and basic syntax of the Python language that you are not allowed to use for this course. Storage StructuresMulticomponent Data. You may not use a tuple, list, string, set, or dictionary to store records or multi-component data. You must use a storage class, unless explicitly stated otherwise. Comparisons. Never use a non-string standard Python storage structure (tuple, list, set, dictionary, etc) as part of a logical expression. That is you should never compare two non-string storage structures if myList == []: # don't do this if (a, b) == (0, 0): # don't do this Tuples. Tuples should only be used to
Slice Operation.
You can not use the slice operation ( String FormattingYou are not allowed to use the new style of string formatting introduced in Python version 3. You are to use the original C-style string formatting. Class DefinitionsA class definition should not include empty parentheses. For example, this is a correct definition class MyClass: # Do this but the following is not class MyClass(): # Don't do this Instructions To AvoidYou may not use the following Python instructions in your programs unless explicitly indicated otherwise. pass continue MiscellaneousChecking Module NamesDo not use the following syntax within any of your modules. if __name__ == "__main__": ........ In general, this syntax is meant for use within a non-driver module for testing purposes. But it can mess up the testing scripts used in grading your submissions. Thus, never use it for any modules in this course unless explicitly stated otherwise.
|