Solutions of Computer Science with Python Class 10
A. Multiple Choice Questions(Tick the correct options) -
1. (d)2. (c)
3. (b)
4. (a)
5. (b)
6. (b)
7. (c)
8. (a)
9. (a)
10. (a)
B. Very short answer type questions -
- To exit from python editor press ctrl + z from keyboard or exit().
- Operators are the symbols which perform the operation on some values. There are two types of operators Unary and Binary Operator.
- Python is available for free anybody can download and make programs in python. Also you can add or update modules or functions in python library.
- Tokens are smallest unit of a python program. Python breaks each lines into a sequence of meaningful component.
- Punctuators are symbols that are used in programming languages to organize sentence structures. The most common punctuators are ' " #
C. Short Answers -
- Escape Sequence is a character that contains a special meaning. There are various types of escape sequence some of them are '\n' used to insert new line and \" is used to assign double quotation in the string.
- A comment is used to write user's notes and description which helps to understand the program. The comment line starts with # symbol. Comments are not compiled by compiler because these are not executable statement.
- In statically typed language the values are constant while executing the program, while in dynamically typed language the variable are dynamic user have to enter the values at runtime for the execution of the program.
- Input statements are used to input values at runtime during the program execution while output statements are used to print the statement on the screen. For inputting the values input() function is used and for output print() function are used.
- Identifiers in python are nothing but user defined names to represent variables, functions, classes, etc. But there are few rules that we have to follow while defining an identifier:
- You can define the variable using letters (a to z), numbers (0 to 9) or an underscore (_).
- You cannot use digits to begin an identifier.
- You cannot use reserve words to declare an identifier.
- Other than underscore (_) you cannot use any other special characters, like !, @, #, $, etc. in an identifier.
- Python contains one special literal i.e. None. None is same as null in other language. We use None to assign null or empty value in some variable. E.g. message=None
- A data type represents the type of data stored into a variable or memory. There are five main data types: Numeric, String, List, Tuple and Dictionary
- Python programs can be executed in two ways interactive mode and scripting mode. In interactive mode the python programs are executed at python prompt.
- In arithmetic operation, the operators are used for arithmetical calculation like addition, subtraction, multiplication, etc. while in relational operation, the operators are used to compare the value between two or more.
- Logical operator is used to check two or more than two conditions. The logical operator also returns the Boolean result either true or false. There are three logical operators: and, or and not. 'And' operator returns true if all the condition are true, while 'or' operator returns true if any of the condition returns true. 'Not; operator returns true if operand is false.
D. Application based questions -
1. (a) Integer datatype(b) Float datatype
(c) String datatype
2. #python code to display your name
name=input("Enter your name: ")
print(name)
3. #python code to input and display integer value
a=int(input("Enter any integer: "))
print("You have entered: ",a)
4. (i) -5
(ii) 8, 16
5. #display the product of two number
a=int(input("Enter a number: "))
b=int(input("Enter another number: "))
print("Product of ",a, " and ",b," is ",a*b)
Comments
Post a Comment
Students you can ask your doubts in comment section