Professional Documents
Culture Documents
More in Python
More in Python
3) a
4) c
5) b
Q-4) Answer the following questions :
There are some rules for naming variables & constants in python:
(a) Create a name that makes sense. Vowel makes more sense
than v.
(b) Use camel case notation to declare a variable. It starts with
lowercase letter. For example: myName
(c) Use capital letters wherever possible to declare a constant.
For example: PI
(d) Never use special symbols like !, @, #, $, % etc.
(e) Constant and variable names should have combination of
letters in lowercase or uppercase or digits or an underscore (_).
4) The two Data types in python are:
(a) Numbers: A Number stores numeric value. Integer, Float, and Complex
values all belong to the python numbers data types. Example: age = 17 ,
Marks = 42.7
(b) SET: Set is an unordered collection of values of any type with
no duplicate entries.
Example: thisset = {“apple”,”banna”,”cherry”}
Print(thisset)
(b) Relational Operators: The operators which are used to compare the
variables are called Relational operators. They are :
> greater than
< lesser than
>= greater than or equal to
<= lesser than or equal to
== is equal to
!= is not equal to
(c) Logical Operators: The operators which are used to compare two or
more logical expressions are called logical operators.