Here is class 12 computer science Unit 1 [Type A] solutions for Sumita Arora back exercise assignment. Below includes both textual and video solutions wherever required. View all the answers in assignment for chapter 1 and for all chapters here.Watch all tutorials for chapter 1: Python Revision Tour – 1.
Tokens: A smallest/single element in Python is called Token. There are 5 types of tokens in Python. Best way to remember them is by the term “POLIK”P – PunctuatorsO – OperatorsL – LiteralsI – IdentifiersK – Keywords
Tokens in Python & different types of tokens in Python
Keywords are reserved words in python with specific meaning but identifiers are the name given to program element (variables, array, classes). Keywords can’t be used as identifiers.
Literals are the raw data, input given in a variable or constant.
Types of literals are : Numerical – such as Integer, Long, Float, ComplexString (‘hello’, ‘1234’), Boolean (True, False), Special (None), Unicode
Yes, nongraphic characters are used in python and process according the reserve application to that respectively. For e.g. print(‘Morning is warm. \n Let’s Play’). Here ‘\n’ will act for breaking into next line.
Other nongraphic characters re ‘\b’, ‘\t’ etc.
Price*Qty, class, 4thCol
Floating constant are represented as by real number and the presiding sign to for positive or negative and if for no sign by default positive value.
For e.g. 3.14, 3.20, 34e-5, 2. etc.
String literals are represented by the value in double or single quotes to a variable.
For e.g. ‘hello’, “going”, ‘1234’ etc.
Operators are the special symbols in python that carry a special operation related to them. Such as ‘+’ for addition, ‘-‘ subtraction, ‘*’ for multiplication.
Unary operator are those which operate on only single operand such as : unary ! (invert) operator yields the bit-wise inversion unary – (minus) operator yields the negation of its numeric argument unary + (plus) operator yields its numeric argument unchanged
Binary operator are those which need two operands to act upon : binary + add both the operand to single value result. binary == compare the both operand for equality.
Statement is an instruction that the python interpreter executes. Such as print and assignment. Sequence of statement make a resulting and working code.
Expression is the combination of operand and variable that needed to be evaluated to give result.
Variables are name space of memory that hold a raw values for the operations. These are important for the flexible nature and storage purpose.
A block or suite is a compound statement that is a part of some named function.
An indentation is the left and right placing of the code and this hold out to be an important key in separating one block from other.
Data Types refers to the type of the data associated with data encountered while processing. Such as integer, string, list etc.
These play an important role as it reduces the changes of error and help to deal with separate data in better way.
Two integer type are supported by python : Integer(signed) Long
Immutable are the type which once initialized can’t be change. For e.g. Tuple, int, float, boolean.
Mutable are the types that can be change after initialization also. For e.g. List, set, dict.
Implicit conversion are taken in account by the compiler or interpreter while the explicit conversion are done by the programmer itself.
Entry controlled loop are the structure which only start execution when the entry condition is satisfied.
For, while are the entry controlled loop in python.
Pass statement is useful where the code satisfies the segment but eventually nothing having to execute.
Code: n=102 if n%2 ==0: passelse: print(‘skip pass case’)
Clear Doubts with Computer TutorIn case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in
You cannot copy content of this page