Showing posts with label class11-Python. Show all posts
Showing posts with label class11-Python. Show all posts

Thursday, 16 January 2020

CBSE Class 11 - Informatics Practices - Python Basics - List Manipulation (Part-2) - Question and Answers (#eduvictors)(#class11Python)

Python Basics - List Manipulation (Part-2) - Question and Answers

CBSE Class 11 - Informatics Practices

CBSE Class 11 - Informatics Practices - Python Basics - List Manipulation (Part-2) - Question and Answers (#eduvictors)(#class11Python)

Based on syllabus of Class 11 Informatics Practices, here are important Questions and Answers covered for the chapter List Manipulation.

The questions and answers will familiarise you with basics concepts of Python Lists and provide a framework for understanding the programming concepts.Software development isn’t any one thing, but a myriad of practices that coalesce into software in the end. Python has been a versatile language and is used by companies to write all sorts of applications.

List is an important data structure, part of a core Python. Lists have a variety of uses including data science, statistics and scientific computing. List is considered as a collection of objects and is ordered and changeable(mutable). It allows duplicate members.


Q1: What is the output of the following code?

list =['I','N','D','I','A']
print(list[0:3])
print(list[3:])
print(list[:])

Answer:
['I', 'N', 'D']
['I', 'A']
['I','N','D','I','A']

CBSE Class 11 - Informatics Practices - Python Basics - List Manipulation (Part-2) - Question and Answers (#eduvictors)(#class11Python)
Display Lists


Q2: What is the output of the following code? What does the '+' operator' do in the code snippet?

Wednesday, 8 January 2020

CBSE Class 11 - Informatics Practices - Python Basics - List Manipulation (Part-1) - Question and Answers(#class11InformaticsPractices)(#eduvictors)

Python Basics - List Manipulation (Part-1)

Question and Answers
CBSE Class 11 - Informatics Practices & Computer Science

CBSE Class 11 - Informatics Practices - Python Basics - List Manipulation (Part-1) - Question and Answers(#class11InformaticsPractices)(#eduvictors)


Q1: What is a list in Python?

Answer: List is a collections of items and each item has its own index value. It is the most versatile datatype available in core Python which can be written as a list of comma-separated values (items) between square brackets.

e.g.
[] # empty list
[1,2,3,4] #list of integers
[2.0, 4.56, 8.91, ] #list of floats
['Sunday', 'Monday', 'Tuesday'] #list of floats
['Nikita', 16, 'Class 11', True, 86.7] # list of mixed values


Wednesday, 1 January 2020

CBSE Class 11 - Informatics Practices - Python - String Manipulation (Part-2) - Question and Answers(#class11Python)(#eduvictors)

Python - String Manipulation (Part-2)

Question and Answers
CBSE Class 11 - Informatics Practices

CBSE Class 11 - Informatics Practices - Python - String Manipulation (Part-2) - Question and Answers(#class11Python)(#eduvictors)


Q1: What are membership operators for strings?

Answer: Two membership operators are:
in Returns True if a substring exists in the given string otherwise returns false.
             e.g. "xy" in "xyz"  #returns True
                    "ab" in "xyz"  #returns False

not in Returns True is a substring does not exist in the given string;
e.g. "ab" not in "xyz"   #returns True
       "xy"  not in "xyz"   #returns False


Q2: What is the output of the following?
str1 = "Hello World!"
str2 = "he"
str3 = "He"
str2 in str1
str3 in str1

Friday, 27 December 2019

CBSE Class 11 - Informatics Practices - Python - Type Conversion and Type Casting - Question and Answers(#class11Python)(#eduvictors)

Python Basics - Type Conversion and Type Casting 

Question and Answers
CBSE Class 11 - Informatics Practices

CBSE Class 11 - Informatics Practices - Python - Type Conversion and Type Casting - Question and Answers


Question 1: What is Type Conversion?

Answer: Type conversion means converting one data type to another data type. Python supports two types of type conversion:

1. Implicity Type Conversion
2. Explicit Type Conversion (also called Type Casting)


Question 2: What is implicit type conversion? Give an example.

Thursday, 26 December 2019

CBSE Class 11 - Informatics Practices - Python - String Manipulation (Part-1) - Question and Answers(#eduvictors)(#cbseClass11Python)

Python - String Manipulation (Part-1)

Question and Answers
CBSE Class 11 - Informatics Practices

CBSE Class 11 - Informatics Practices - Python - String Manipulation (Part-1) - Question and Answers(#eduvictors)(#cbseClass11Python)

Q1: What is a string in Python?

Answer: String is a sequence of characters, which is enclosed between either single(' ') quotes or double quotes(" "), python treats both single and double quotes same.
e.g. 
      str1 = "Welcome to the Python World."


Q2: Can a double-quoted string contain single quotes? If yes, give an example.

Answer: Yes. 
Example:
str1 = "Nitika's Fashions" 
print(str1)

Similarly, A single-quoted string can also contain double quotes:
Example:
str2 = '"Help!", he exclaimed.'
print(str2)

CBSE Class 11 - Informatics Practices - Python - String Manipulation (Part-1) - Question and Answers(#eduvictors)(#cbseClass11Python)


Friday, 9 August 2019

CBSE Class 11 - Informatics Practices - Python Basics Questions and Answers (Part-2) (#eduvictors)(#cbsenotes)

Python Basics  Q & A (Part-2)

CBSE Class 11 - Informatics Practices
CBSE Class 11 - Informatics Practices - Python Basics  Questions and  Answers (Part-2) (#eduvictors)(#cbsenotes)


Q1: What are the different modes that can be used to test Python Program?  

Answer: In Python, programs can be written in two ways namely Interactive mode and Script mode.
Interactive mode or Interpreter mode allows us to write codes in Python command prompt  (  >>> ).
Script mode is used to create and edit python source file with the extension .py


Q2: Write the command to leave python shell or interpreter.

Answer: ^D (Ctrl+D) or quit () is used to leave the interpreter.


Q3: What is the advantage of interpreter mode?

Answer:  Working in interactive mode is convenient for beginners and for testing small pieces of code, as we can test them immediately.