#cbse computer science textbook for class 11
Explore tagged Tumblr posts
Text
CBSE 11th and 12th Schools Dwarka: Why OPG World School Is the Ideal Choice for Senior Secondary Excellence
When it comes to CBSE 11th and 12th schools in Dwarka, OPG World School stands out as a beacon of academic excellence, holistic development, and future-ready education. For students and parents seeking the best academic path during the critical years of Classes 11 and 12, OPG World School offers the right blend of rigorous academics, co-curricular opportunities, and a nurturing environment.
Located in the heart of Dwarka, Delhi, OPG World School has emerged as one of the best CBSE schools in Dwarka Delhi, trusted by families who prioritize quality education and student success.
Why the Senior Secondary Years Matter
Classes 11 and 12 are not just any academic stages—they’re foundational years that define a student’s career path. Whether aiming for engineering, medicine, commerce, or humanities, the right guidance during these years is crucial. This is where OPG World School plays a transformative role. Our school is designed to support students in not just scoring well in board exams but also in excelling at entrance exams, personality development, and critical thinking.
A Premier Choice Among CBSE 11th and 12th Schools in Dwarka
OPG World School offers a focused, dynamic, and student-centric curriculum for Classes 11 and 12 under the Central Board of Secondary Education (CBSE). The school is among the top 10 schools in Dwarka Delhi, known for its consistent academic results, modern infrastructure, and experienced faculty.
Stream Options Offered:
Science Stream (Medical and Non-Medical)
Commerce Stream
Humanities Stream
Each stream is designed to be both academically intensive and aligned with national and international educational benchmarks.
What Makes OPG World School Stand Out?
1. Academic Excellence With a Modern Edge
With over a decade of educational service, OPG World School has built a legacy of academic distinction. We are proud of our consistent record of CBSE board toppers and 100% pass rates. Our curriculum goes beyond textbooks, integrating project-based learning, regular assessments, and interactive teaching.
2. Highly Qualified Faculty
Our faculty members are not just subject-matter experts; they are mentors. With regular training and workshops, teachers stay updated with the latest teaching methods and CBSE norms. This commitment has helped OPG gain recognition as one of the best CBSE schools in Dwarka Delhi.
3. Individual Attention and Mentoring
Small class sizes ensure that each student receives personalized attention. Regular parent-teacher meetings, career counseling sessions, and one-on-one mentoring provide students with the support they need to thrive in their studies and personal growth.
4. Competitive Exam Support
Apart from the core CBSE curriculum, OPG World School offers integrated coaching for entrance exams like:
JEE
NEET
CUET
NDA
CLAT
This dual approach ensures that students don’t need to look for external coaching, saving time and keeping their focus aligned.
CBSE Schools Near Me for 11 and 12 Dwarka – A Trusted Local Choice
For families searching for CBSE schools near me for 11 and 12 Dwarka, OPG World School is not just nearby—it’s the neighborhood school with a national reputation. Our location in Sector 19B, Dwarka, makes us easily accessible while offering a calm and safe environment conducive to learning.
Local Convenience, Global Standards
While conveniently located, our teaching methods and global exposure prepare students for both Indian and international academic futures. Whether it's foreign language training, student exchange programs, or international competitions, our senior secondary students get the opportunity to broaden their horizons.
Infrastructure That Supports Holistic Learning
At OPG World School, learning is not confined to classrooms. Our campus is equipped with:
Modern Science Labs (Physics, Chemistry, Biology)
Computer Labs with Latest Software
Smart Classrooms with AV Facilities
Library Stocked with CBSE Reference Materials and Journals
Sports Facilities (Basketball, Football, Badminton, Table Tennis
Auditorium for Cultural and Academic Events
Counseling and Wellness Rooms
Such amenities create an environment where students can explore, experiment, and evolve into confident individuals.
Focus on Life Skills and Values
The senior secondary journey at OPG doesn’t just prepare students academically. Our life skills program ensures students develop:
Communication and leadership skills
Decision-making and problem-solving capabilities
Emotional intelligence and empathy
Career awareness and digital literacy
These life skills ensure students are prepared not only for exams but for life beyond school.
Co-Curricular and Extracurricular Opportunities
Education at OPG World School goes beyond the classroom. We encourage students to participate in:
Model United Nations (MUN)
Debates and Public Speaking
Cultural and Annual Events
Science and Innovation Exhibitions
Music, Dance, Drama Clubs
Such opportunities build confidence, creativity, and collaboration—key qualities for success in the 21st century.
Career Guidance and Counseling
One of the most vital aspects of senior secondary education is choosing the right career path. OPG World School offers:
Aptitude Testing
Stream Selection Guidance
Career Seminars by Industry Experts
University Admission Workshops
This guidance is instrumental in helping students and parents make informed decisions about their futures.
Recognitions and Rankings
OPG World School has received several accolades that reinforce its position among the top 10 schools in Dwarka Delhi. Our consistent performance in board results, extracurricular excellence, and student satisfaction has led to recognition from educational bodies, media houses, and parent forums alike.
Admissions Open for CBSE 11th and 12th – Join the OPG Family
We are now accepting applications for Classes 11 and 12 for the upcoming academic session. Students from all streams are welcome to apply. Whether you’re moving from another CBSE school or transitioning from another board, our admission process is smooth and supportive.
How to Apply:
Visit our official website: opgworldschool.com
Visit our campus in Sector 19B, Dwarka for a guided tour
What Parents and Students Say
"OPG World School changed my daughter’s life. The academic rigor, combined with emotional support and career guidance, helped her get into her dream college." — Parent of Class 12 Student
"The teachers here genuinely care about you. It’s not just about marks, it’s about growth and confidence." — Class 12 Humanities Student
Final Thoughts:
The choice of school for Classes 11 and 12 can significantly impact a student’s academic journey and career prospects. OPG World School offers a perfect balance of tradition and innovation, care and challenge, local accessibility and global vision.
As a recognized leader among CBSE 11th and 12th schools in Dwarka, we invite you to explore our campus, meet our faculty, and become part of a community that is committed to student success.
If you're searching for CBSE schools near me for 11 and 12 Dwarka, or want your child to study at one of the best CBSE schools in Dwarka Delhi, look no further—OPG World School is the right destination for senior secondary excellence.
FAQs
1. What are the best CBSE schools in Dwarka for Class 11 and 12?
Some of the top CBSE schools in Dwarka for senior secondary include OPG World School, DPS Dwarka, and Mount Carmel School, offering strong academics and co-curricular programs.
2. How can I find CBSE schools near me for 11th and 12th in Dwarka?
Use Google Maps or school directories by searching “CBSE schools near me for 11 and 12 Dwarka” to explore options based on location, ratings, and reviews.
3. What is the admission process for Class 11 in Dwarka CBSE schools?
Admission typically depends on Class 10 board results, preferred stream (Science, Commerce, Humanities), and seat availability. Some schools may also hold interviews or counseling.
4. Do CBSE schools in Dwarka offer all major streams in Class 11?
Yes, most reputed CBSE schools in Dwarka offer Science, Commerce, and Arts streams, with subject combinations to suit different career paths.
5. Which are the top 10 CBSE schools in Dwarka, Delhi?
Top choices include:
OPG World School
DPS Dwarka
Mount Carmel School
Bal Bharati Public School
Venkateshwar International School
Indraprastha International School
N.K. Bagrodia Public School
Sri Venkateshwar International
ITL Public School
JM International School
0 notes
Text
Best School for 11 and 12 in West Bengal: Where Academic Brilliance Meets All-Round Development
The senior secondary years are the foundation for board exams, competitive entrance tests, and future career paths. At this crucial stage, students need a school that not only ensures academic excellence but also fosters confidence, curiosity, and all-round development. Choosing the best school for 11 and 12 in West Bengal is more than just selecting an institution; it's about finding a place that nurtures your academic dreams and personal growth.
Among the senior secondary schools in West Bengal, ODM International School stands out as a leader, offering an enriching environment where students can succeed both scholastically and personally, preparing them for success in higher education and beyond.
Academic Excellence at ODM International School
As one of the best CBSE senior secondary schools in West Bengal, ODM International School is committed to delivering a world-class education that aligns with the evolving demands of global learning standards. The school offers a meticulously structured curriculum under the CBSE board with Integrated classes that give students an edge in board exams and national-level competitive tests like JEE, NEET, CUET, and CLAT.
The school has highly qualified educators, subject matter experts, and career mentors who guide students through a combination of theoretical knowledge and practical applications. Through conceptual clarity, logical thinking, and research-based learning, ODM ensures that students excel in their academics and develop critical problem-solving skills.
State-of-the-Art Infrastructure and Learning Facilities
Environment matters a lot for students' holistic development. The modern equipment, like well-equipped laboratories, modern libraries, smart classrooms, spacious ground for extracurricular activities, impacts a lot on students' success.
ODM International School offers a cutting-edge learning environment that enhances students' educational experience. The campus is equipped with:
Smart Classrooms: ODM has smart classrooms with interactive tools that offer students digitally enhanced learning spaces.
Advanced Science and Computer Labs: The advanced and AI-enabled labs of ODM provide hands-on learning in physics, chemistry, biology, and computer science.
Well-Stocked Library: The Library is a storehouse of knowledge. ODM International's library has a vast collection of academic resources, journals, and reference materials that support students at any point they need help.
Career Guidance and Counseling Centers: Senior secondary students are more likely to need proper career counselling and guidance. Recognising this, ODM International offers personalised mentorship to students for academic and career planning.
Competitive Exam Training: The integrated classes by ODM International provide dedicated coaching sessions for students aiming for IITs, AIIMS, NITs, and top universities worldwide, making the school the best CBSE Senior Secondary school in West Bengal
These world-class facilities position ODM International School among the premier Senior Secondary schools in West Bengal that emphasise a comprehensive learning approach.
All-Round Development: Beyond Academics
At ODM International School, education is far beyond the confines of textbooks. The school prioritises extracurricular activities to ensure students develop all the skills necessary for life. Some of the key initiatives include:
1. Leadership and Personality Development
Students are encouraged to take part in leadership programs, debates, MUN conferences, and student-led organisations that foster confidence, communication skills, and leadership qualities.
2. Sports and Physical Well-being
The school provides state-of-the-art sports facilities for cricket, football, basketball, badminton, and athletics. Regular training sessions, inter-school competitions, and fitness programs promote physical well-being and discipline among students.
3. International Exposure and Exchange Programs
ODM International School has collaborations with global institutions, and international Schools of South-East Asian Nations, offering students opportunities for international exchange programs, global immersion tours, and exposure to diverse cultures and educational systems.
4. Arts, Music, and Cultural Activities
ODM International has a strong emphasis on creative arts. So, they provide special classes where students can learn music, dance, drama, painting, and photography to boost their artistic and creative expression.
5. Community Service and Social Responsibility
ODM International Strongly believes in Character education. So, under the CPX Learning Model, ODM instils values of compassion and social responsibility through active participation in community service programs, environmental initiatives, and charity drives.
Seamless Process for 11th class admission in West Bengal
ODM International School is the best option for parents and students seeking 11th-class admission in West Bengal. ODM International's admission process is streamlined and student-friendly. The school offers admissions in the Science stream with subject combinations that cater to diverse career paths. The process includes:
Academic Performance Review: Based on Class 10th board results.
OSAT (Entrance Assessment): To evaluate the student's aptitude and subject proficiency.
Personal Interaction: A discussion with the academic counsellors to understand career goals and aspirations.
Students aspiring to enrol in one of the best CBSE senior secondary schools in West Bengal can apply online or visit the school campus for direct counselling and admission guidance.
Why Choose ODM International School?
Ranked among the best senior secondary schools in West Bengal for its academic excellence and student success rate.
A perfect blend of advanced curriculum, global exposure, and practical learning.
Personalised career mentorship and professional coaching for national and international competitive exams.
A safe, and supportive learning environment with modern residential facilities.
A proven record of yielding top achievers in board exams and entrance tests.
Conclusion
The choice of a senior secondary school plays a defining role in shaping a student's academic and professional journey. With its commitment to quality education, advanced learning infrastructure, and focus on holistic student development, ODM International School rightfully stands as the best school for 11 and 12 in West Bengal. Whether you are seeking academic rigour, career-focused mentorship, or an environment that nurtures creativity and leadership, ODM offers the ideal platform to unlock a student's full potential.
#best school for 11 and 12 in West Bengal#Best CBSE Senior Secondary school in West Bengal#Senior Secondary schools in West Bengal#11th class admission in West Bengal#best cbse schools in durgapur#top cbse school in durgapur#top school in durgapur
0 notes
Text
CBSE Schools in Gurugram provide abundant facilities for Quality Education & All-Round Development
Nelson Mandela once stated–
"Education is the most powerful weapon which you can use to change the world."
And it's not a cliché! Education has a revolutionary power that nurtures curiosity, encourages creativity, and prepares students for life.
In the 21st century, schools have an important responsibility to mold young minds into a great person. School gives students a platform where they can develop academically, socially, and emotionally. Gurugram, a city of repute for being a dynamic educational hub, boasts a few of the top-performing CBSE schools that provide bountiful facilities for students to ensure students receive quality education and holistic development. Among them, ODM International School, Gurugram, stands out as a beacon of excellence. Let's find out why ODM is one among the finest CBSE schools in Gurugram.
A Strong Academic Foundation with Exceptional Facilities
The best educational institutions are those that focus on conceptual clarity, problem-solving skills, and practical applications rather than blind memorisation. Many CBSE schools in Gurugram, including ODM International School, have taken this approach to the next level by incorporating smart classrooms, advanced laboratories, and interactive learning modules. These schools not only emphasise academic excellence but also ensure that students develop analytical thinking, leadership qualities, and a strong moral foundation.
Preparing Students for Competitive Exams
The senior secondary years, particularly classes 11 and 12, play a defining role in a student's career. Recognising this, the best 11th and 12th schools in Gurugram provide specialised coaching for competitive exams like JEE and NEET. These schools offer structured preparatory programs, including personalised mentorship, mock tests, and in-depth subject analysis to help students excel in national-level entrance exams.
Additionally, for aspiring engineers, JEE coaching in Gurugram is seamlessly integrated into the school curriculum. ODM International School provides expert guidance from experienced faculty, ensuring students easily grasp complex concepts while balancing their board exam preparation.
Beyond the Classroom: Sports, Arts, and Extracurricular Activities
Education is much more than textbooks, and ODM International School strongly believes in this. From state-of-the-art sports facilities to dedicated music and arts programs, students are encouraged to explore their talents and interests. The schools provide:
Well-equipped sports complexes for cricket, basketball, swimming, and athletics.
Music and dance programs by Celebrity trainers to promote cultural and creative expression.
STEM-based extracurricular activities such as robotics, coding, and science clubs.
Public speaking and debate clubs to enhance communication and leadership skills.
Personalised Attention and Career Guidance
One of the distinguishing features of top CBSE schools in Gurugram is their focus on personalised attention. ODM International School ensures smaller class sizes, mentorship programs, and dedicated counselling services so students receive the guidance they need to excel. Career counselling sessions, psychometric assessments, and interactive workshops help students make informed choices about their future paths.
State-of-the-Art Infrastructure for an Enriching Learning Experience
Modern infrastructure plays a vital role in supporting quality education. Many of the best 11th and 12th schools in Gurugram, including ODM International School, boast:
Smart classrooms with interactive boards and digital resources.
Well-stocked libraries with academic and non-academic literature.
Research-oriented science, math, and computer labs that encourage hands-on learning.
Collaborative learning spaces that foster teamwork and critical thinking.
A Safe and Inclusive Learning Environment
Safety and inclusivity are at the heart of a nurturing educational experience. ODM International School prioritises student safety through CCTV surveillance, secure transport facilities, and trained staff for emergency preparedness. Additionally, initiatives promoting mental health awareness, anti-bullying policies, and inclusivity programs create an environment where every student feels valued and empowered.
Final Words:
Choosing the right school is one of the most significant decisions for a student's future. The CBSE schools in Gurugram provide a balanced mix of academic excellence, world-class infrastructure, and holistic development programs. With facilities that support JEE coaching in Gurugram and specialised career guidance, ODM International School ensures that students are well-prepared to meet their aspirations.
If you are looking for the best 11th and 12th schools in Gurugram, consider ODM International School, where education goes beyond traditional learning to nurture future-ready individuals.
#CBSE schools in Gurugram#Jee coaching in Gurugram#best 11th and 12th schools in gurugram#international schools in gurgaon#best schools in gurgaon#best cbse school in haryana#odm international school gurugram
0 notes
Text
View On WordPress
#11 cbse computer science syllabus#11th cbse computer science in english#a donation of mageweave tbc#a donation of silk tbc#a python program example#a quality primary education#cbse class 8 computer science syllabus#cbse computer science textbook for class 11#class 12 computer science apni kaksha#computer educations#donation admission
0 notes
Text
NCERT Solutions Class 11 Computer Science Free PDF Download
To free download NCERT Questions and answers of NCERT Books All Classes Physics, Chemistry, Biology, History, Political Science, Economics, Geography, Computer Science, Accountancy, Business Studies, Hindi, English, Mathematics, EVS, Social Science and Home Science; do check NCERTPREP website. This site provides sample papers with solution, test papers for chapter-wise practice, NCERT book solution, NCERT Exemplar solutions, quick revision notes for ready reference, CBSE guess papers and CBSE important question papers. Sample Paper all are made available through the best app for CBSE students and NCERTPREP website.
Class 11 NCERT Solution Computer Science Python includes all the questions given in NCERT Books for all Subject. Here all questions are solved with detailed information and available for free to check. NCERT Solutions Class 11 Computer Science Python are given here for all chapter wise. Select the subject and choose chapter to view NCERT Solution chapter wise.
Computer Science is a practical subject. Deriving every answer on your own is a tedious task. Most of the students find it difficult to solve the problems or the practice exercise of the NCERT textbook difficult. So, what’s the best way out? The best way is to have a solution book. The first unit comprises of computer fundamentals, software concepts, data representation, microprocessor, and memory. The basics of Operating systems and some common algorithms are dealt with here. The data representation is the main and very important chapter of computer science.
The main concept of binary numbers and how they are stored in computer memory is well explained. A student should learn to convert a decimal number into binary and vice versa. Practice the question given at the end of your NCERT books and verify the answer from the solution book.
The solution book also explains step by step how the answer has been derived. All the concepts related to microprocessors such as Instructions sets, 8085, and 8086 microprocessors have been explained in the fourth chapter.
Moving over to the next unit i.e. program methodology teaches us how to write any language in syntax. How the comments are used and why writing comments is very important in coding. The next chapter algorithms and flowcharts throw light over modular and structured programming. The various operators such as AND, OR, and NOT have been discussed in detail over here.
The third and the fourth unit deals with the language “PYTHON”. Python is a programming language basically the most trending and acceptable language in today’s world. You can build anything to everything by using python’s libraries and tools. It is used in web development, Blockchain development, somewhere in AI and ML as well. It’s a very easy language with many active communities worldwide. It has been rated as 5/5 over the user-friendly ratings.
The third unit basically teaches you the basics of python, the operators, functions, and loops. The fifth unit calls for some nice coding skills. A solution book helps a student in the right kind of logic building so that the code development process goes clear in the kind of a student
NCERT Solutions of NCERT Books All Classes for CBSE class 3, 4, 5, 6, 7, 8, 9, 10, 11 & 12 are very helpful to students. Although, NCERT solutions contain only chapter-end questions and answers yet these are considered as key questions. Most of the questions in exams are either same or similar to these questions. So, it is advised that students must go through the NCERT Text Books and practice all the questions given at the end of the chapter. These questions will clear their basic doubts. We also recommend students should read the whole NCERT book line by line and prepare notes from NCERT books. It is always recommended to study NCERT books as it covers the whole syllabus. These questions with detailed explanation are now available in NCERTPREP.com for free to view and download.
First of all, Student must understand that NCERT textbook answers are not enough for exam preparation. Therefore, they must take NCERT textbook question and answers as basic learning tools. These questions and answers are basically meant for understanding the concepts. NCERT textbooks are certainly a good source of quality content. Hence, it is expected that students should not settle for chapter end questions only rather they should read the whole book thoroughly.NCERT Solution of NCERT Books All Classes are available in PDF format for free download. These ncert book chapter wise questions and answers are very helpful for CBSE exam. CBSE recommends NCERT books and most of the questions in CBSE exam are asked from NCERT textbooks.
We hope that our NCERT Solutions Class 11 Computer Science Python helped with your studies! If you liked our NCERT Solutions for Class 11, please share this post.
1 note
·
View note
Text
CBSE Class 11 Courses Module
Class 11 is the first step in the career. It is generally considered more difficult than class 12. The reason for this is, the study of class 11 is way different from that which students studied till class 10. So, several times it happens that students are unable to cope up with all the subjects together. Hereby, Edubull presents 11 different subjects for students to study according to their interests and stream. The following are the subjects available.
Maths - consist of Sequence and Series, Complex Numbers, Basic Arithmetic and Algebra, Transformation of Equations, Trigonometry, Coordinate Geometry, Circle, Hyperbola, Limits, Differentiability.
Maths Resources-I - Contains Sets, Relations and Functions, Trignometry, Mathematical Induction, Complex Numbers, Linear Inequalities, Permutation & Combination, and Binomial Theorem.
Maths Resources-II - Includes Sequence Series, Straight Lines, Conic Sections, Three Dimensional Geometry, Limits and Derivatives, Mathematical Reasoning, Statistics, and Probability.
Maths resources-III - Illustrates the concept in a very interesting manner which helps the student to understand the concept instead of mugging up formulas.
Maths resources-IV - Focus on more and more practice of sums and give easy ways to solve complicated questions.
Maths resources-V - Provides students the animated videos to learn with even more interest.
Maths resources-VI - Solves the questions in a manner that motivates the students to practice more.
Pre-Algebra - Provides more knowledge about whole number, number concepts, and integers for a better understanding of concepts.
Probability Resources - Is customized only for probability and covers the whole probability concept of class 11.
Arithmetic Maths Resources - Help the students who want to learn about Math 20 - Arithmetic Review.
Algebra Resources - Is customized for algebra lovers and provides a vast knowledge of algebra.
8 Modules to Learn
Every student either faces problems in organic or in inorganic chemistry. Edubull has divided chemistry into 8 modules to make all the branches of chemistry easy for the students.
Chemistry-I - Includes Atomic Structure Part - I, Atomic Structure Part - II, States of Matter, Chemical Bonding, Nuclear Chemistry, Electrochemistry, and Structure of atom.
Chemistry-II - Provides students with complex chemistry concepts like Classification of Elements and Periodicity in Properties, Chemical Bonding, and Molecular Structure, States of Matter in a simplified manner and provides suitable notes of the same.
Chemistry Resources-I - Explains all the concept of class 11 chemistry with several examples and make it way more interesting.
Chemistry Resources-II - Provides an explanation of concepts through animations which makes it interesting for the students to gain the knowledge as well as to learn.
Organic Chemistry Resources-I - Covers 3 chapters of organic chemistry, that are- some basic principles and techniques, hydrocarbons, and environmental chemistry.
Organic Chemistry Resources-II - Covers several topics to provide specialized knowledge for each of the topics i.e. Chirality, Newman Projections, Organic Chemistry Naming Examples, Sn Reactions, E Reactions, Comparing E2 E1 Sn2 Sn1 Reactions, Alcohols, Amine Naming Introduction, and Carboxylic Acid Introduction.
Chem Physical - Enhances the knowledge of students in physical chemistry in several topics which include Some Basic Concept of Chemistry, Atomic Structure, States of Matter, Equilibrium, Thermodynamics, and Redox Reaction.
Chemistry Inorganic Resources - Makes the inorganic chemistry easy for students by explaining Chemical Bonding and Molecular Structure, Classification of Elements and Periodicity, Hydrogen & Water, S Block Elements, and P Block Elements.
8 Modules to Explore Physics with a Wider Point of View
Physics is a weakness of many students. But the key to study physics is understanding each concept properly. Edubull teaches physics to the students in 8 modules.
Physics - Covers all the basic concepts of class 11 physics including Dimensional and Error Analysis, Introduction to Kinematics, Projectile Motion, Kinematics of Circular Motion, Particle Dynamics, Newton’s Law, Wave Motion, and Physical Properties of Waves.
Physics Resources-II - Gives various teaching aids, notes, and practice sessions of various topics which include Gravitation, General Properties of Matter, Thermal Properties of Material, Kinetic Theory of Gases, Oscillations, and Waves.
Physics Resources-III - Helps the students to build interest in physics by explaining different concepts with several examples and practical.
Physics-IV - Clarifies the concepts of topics covered in Physics of ICSE Standard with a lot of examples.
Physics Resources-V - This course is for those who want to learn the concepts of physics in an even more detailed manner.
Science - Clarifies the basic concepts of Theory and makes it more interesting for students in order to motivate students to study even more.
Thermodynamic and kinetic resources -This course is specialized for concepts of thermodynamic and kinetic physics.
Physics Animation - As the name suggests, explains the concepts through animations to make it more interesting. It includes introduction to nuclear reactor and introduction to magnetic field and magnetic field lines of force.
4 Modules to Make Biology more Interesting
However, biology is not that difficult to learn but for those who can’t just mug up and want to understand each and every concept with propper detail, edubull brings up biology in 4 modules.
Biology-I - Helps students to get an in-depth understanding of the basic concepts of topics of the biology of class 11.
Biology resources-II - Displays animated videos that grab the attention of the students who have no interest in the subject and have left it. It is also intended to help clarify the basic concepts of topics through illustrative interactive lectures and practical in a very interesting manner.
Biology resources-III - Illustrates different concepts through interactive lectures and enhance the student’s interest in the subject.
Biology resources-IV - Clarifies the most basic topics of biology.
4 Modules to get the Strategy for Accountancy
Every student gets frustrated when the entries at the last in the accounts answer does not match. Edubull provides you a platform where you can learn accounts in 4 modules and then you’ll easily be able to find your own mistake.
Accounts Resources (double entry book keeping part-1) - Explains several chapters in an easy way which include Introduction to Accounting, Basic Accounting Terms, Theory Base of Accounting, Bases of Accounting, Accounting Equation, Accounting Procedures, Origin of Transaction, Journal and Ledger, Special Purpose Books, Bank Reconciliation Statement, and Trial Balance.
Accounts Resources (double entry book keeping part-2) - Continues part-1 by including topics like Depreciation, Provisions and Reserves, Accounting for Bills of Exchange, Rectification of Errors, Adjustments in Preparation of Financial Statements, Accounts from Incomplete Records, and Computerised Accounting.
Accountancy - Explains the basic chapters of accounts of class 11 which include Accounting Equations, Journal Entries, Final Accounts, and Ledger Posting and Trial Balance.
Introduction to Financial Statement - Is specialized to learn the basic concepts of financial statements.
2 modules to Increase English Proficiency .
For English, edubull has made 2 modules, one of which explains in English and the other in Hindi.
Hornbill - Explains all the chapters of the textbook hornbill in a very interesting manner. The chapters include The Portrait of a Lady, A Photograph, We're Not Afraid to Die, The Voice of the Rain, Discovering Tut: The Saga Continues, Landscape of the Soul, The Browning Version, Childhood, and Father to Son.
Hornbill (Hindi) - Explains all of these in Hindi.
3 modules to Enhance the Skills in Informatics Practices.
For the IP lovers, edubull has made 3 modules to learn and practice.
How to build a computer - Provides students the basic knowledge of Computers and its parts, its importance, and various other basic information about computers so that the learner who is new to computers must learn about building a computer from the beginning.
SQL for beginners - Explains the basics and details of structured query language in both - Hindi and English.
Computer networks - As the name suggests, give knowledge to students about different computer networks.
8 Modules to Enhance the Skills in Computer Science
All the students you want to enrich their skills in the field of computer science have the option here to learn and practice according to their interests.
Introduction to programming - Guides the students in Hindi language about how to do programming and then the tasks are given to students for practice.
Computer science resources - Enrich the students with the basics of the computer that helps the students to start with small programming tasks.
MS Word 2016 (Hindi) - Explains the vast MS Word 2016 in Hindi by dividing it into topics like Beginning, Basic Editing, Formatting, Copying and Moving Text and Objects, Editing Features, Paragraph Formatting, Tables, Page Formatting, Graphics & Pictures, Footnote & Endnote, and Advanced Tools.
Notepad (Hindi) - Explains all the features debate in Hindi.
Windows 10 operating system (Hindi) - Explains windows 10 in detail in Hindi. It’s very useful for those who stay updated with the latest technologies.
MS PowerPoint 2016(Hindi) - This is a module in which PowerPoint is taught within the subheadings like The Fundamentals, Slides, Editing, Formatting, Images, Multimedia, and Objects, and Transitions and Animation Effects.
MS excel 2016 - This is also divided into subtopics to be specific and the topics are The Excel Window, Editing, Formatting, Formulas, Hlookup Vlookup, Pivot, Chart, Short Cuts, and Practice Sheets.
MS excel 2016 (Hindi) - Explains the same in Hindi with somewhat different topics which include The Excel Screen, Formatting, Formulas, Hlookup Vlookup, Pivot, Chart, and Practice Sheets.
3 Modules to learn Business Studies in an Interesting Manner
Business studies is beautifully divided in 3 modules by edubull according to its topics.
Business study resources (foundation of business part-1) - Explains almost all topics of textbook of business studies of class 11, which are Nature and Forms of Business, Forms of Business Organisation, Private, Public and Global Enterprises, Business Services, Emerging Modes of Business, Social Responsibility of Business and Business Ethics.
Business study resources (finance and trade part -2) - This is divided into 2 topics, that are sources of business finance and small business.
Business finance - This is personalized for those who want to startup with a new business.
7 Modules to understand the importance of Physical Education.
However, yoga is a vast practice, still, edubull has tried to collect the most of it within 7 modules.
Yoga postures by Shilpa - is a module that makes the students learn about various yoga postures and get motivated to stay healthy.
Face Yoga - is very useful for the students who stay up till late because it puts a great effect on how the face looks.
Diet and nutrition - teaches the students about how can one stay fit with a balanced diet.
Healthy eating tips - is somewhat similar to diet and nutrition, yet a lot different from it. You’ll know the difference, once you’ll attend the lectures.
Get healthy, get happy - is a module in which students are counseled to stay happy in order to be fit physically.
Yoga for Kids - brings out wonderful yoga postures specialized for kids which are highly effective on a child’s growth and development.
Yoga in office - Yoga in office’ is based on stretching which should be done while prolong sitting.
1 module to enrich your interest in Political Science
Since it just has 1 module ‘political science’, it is divided into several chapters in order to gain the most. The chapters are Constitution Why and How?, Rights in Indian Constitution, Election and Representation, Executive, Legislature, Judiciary, Federalism, Local Governments, Constitution as a Living Document, and The Philosophy of the Constitution.
1 note
·
View note
Text
NCERT Solutions for Class 11 Maths
LeanCBSE.in provides Class 11 Maths NCERT Solutions for Free. We have completely solved each question in NCERT (National Council of Education Research) textbook of Class 11 mathematics. NCERT Textbooks are widely used by schools following CBSE. NCERT solutions for class 11 maths covers exercises given in Sets, Relations and Functions, Trigonometric Functions, Principle of Mathematical Induction, Complex Numbers and Quadratic Equations, Linear Inequalities,Permutation and Combinations, Binomial Theorem, Sequences and Series,Straight Lines, Conic Sections, Introduction to Three Dimensional Geometry, Limits and Derivatives,Mathematical Reasoning. LearnCBSE.in provides easy and quick access of chapter-wise questions and answers in a single page. Step by Step solutions for all 16 Chapters in NCERT Class 11 Maths Textbook.
NCERT Solutions
NCERT Solutions Class 11 Physics
NCERT Solutions Class 11 Chemistry
NCERT Solutions Class 11 Biology
NCERT Solutions Class 11 Hindi
NCERT Solutions Class 11 English
NCERT Solutions Class 11 Computer Science
#NCERTSolutions#NCERTSolutionsClass11Physics#NCERTSolutionsClass11Chemistry#NCERTSolutionsClass11Biology#NCERTSolutionsClass11Hindi#NCERTSolutionsClass11English#NCERTSolutionsClass11ComputerScience
5 notes
·
View notes
Text
CBSE Schools Near Me for 11 and 12 Dwarka | Why OPG World School Stands Out
When parents and students search for CBSE schools near me for 11 and 12 Dwarka, they’re not just looking for any school—they’re searching for a reliable, future-ready institution that balances academic excellence with holistic development. Among the many options available, OPG World School stands tall as a trusted name that consistently delivers high-quality education and prepares students for the competitive world beyond school.
Why Choosing the Right CBSE School for Grades 11 and 12 Matters
The senior secondary years—classes 11 and 12—are pivotal. This is when students take their first significant steps toward professional courses, competitive exams, and career-building. It is essential to select a school that not only adheres to the CBSE curriculum but also nurtures intellectual curiosity, builds confidence, and provides access to robust guidance and mentorship.
That’s exactly what OPG World School in Dwarka offers.
Academic Excellence in CBSE 11th and 12th Education
Recognized among the top CBSE 11th and 12th schools Dwarka has to offer, OPG World School delivers a rigorous and future-aligned academic program. The school follows the latest CBSE syllabus and guidelines, providing streams in Science, Commerce, and Humanities with specialized faculty and modern infrastructure to support every learner's goals.
Personalized Subject Choices and Counseling
Students are guided by professional counselors and experienced educators to select the right stream and subject combinations that match their skills, interests, and career aspirations. This approach ensures each student receives a personalized academic experience, a major advantage when comparing with other best CBSE schools in Dwarka Delhi.
Faculty That Makes a Difference
At the core of OPG World School’s success is its experienced and dedicated teaching faculty. These are not just educators but mentors who foster a growth mindset, help students achieve academic goals, and provide emotional and motivational support.
Each teacher is trained to help students succeed in CBSE board exams, competitive exams like JEE, NEET, CUET, and beyond, giving the school a consistent record of high performance.
A Holistic Learning Environment
Education at OPG World School is more than textbooks and exams. The institution believes in a holistic development model—one that incorporates academics, life skills, sports, arts, and community engagement. This well-rounded education helps students emerge as confident, socially responsible citizens ready to lead and innovate.
Co-curricular and Extra-curricular Activities
From inter-school competitions and debates to robotics clubs and art workshops, students are encouraged to explore their talents beyond the classroom. This balanced approach is a key reason why OPG is consistently ranked among the top 10 schools in Dwarka Delhi.
World-Class Infrastructure
The school campus is designed with the modern learner in mind. Spacious classrooms equipped with smart boards, well-stocked science and computer labs, a vibrant library, and fully functional sports facilities create an environment where students can thrive.
Some highlights include:
Digitized classrooms for interactive learning
Modern laboratories for Physics, Chemistry, and Biology
Career guidance cell
Multipurpose auditorium
Indoor and outdoor sports complexes
These facilities not only support the academic curriculum but also promote self-learning and collaboration.
Focus on Competitive Exam Preparation
Unlike many schools that prioritize board exams only, OPG World School also offers integrated support for students aiming to crack entrance exams like:
JEE (Main and Advanced)
NEET
CUET
NIFT, NID, CLAT and others
By integrating these preparations with the CBSE curriculum, students at OPG don’t need to rely entirely on external coaching, making it a top contender among CBSE 11th and 12th schools Dwarka.
Career Counseling and University Guidance
Preparing students for life after school is a major focus area. OPG World School provides dedicated career counseling sessions, aptitude testing, and university application support—both for Indian and international institutions. From profile building to SOP writing and scholarship assistance, the school ensures its students are well-prepared for college admissions.
This proactive approach sets it apart from many other institutions listed among the best CBSE schools in Dwarka Delhi.
Safety and Wellbeing First
A safe and secure campus is essential, especially for senior students dealing with academic pressures. OPG World School offers:
24/7 surveillance and trained security staff
On-campus medical facilities
Regular mental health counseling and emotional wellbeing sessions
Zero-tolerance policy toward bullying and discrimination
The school community fosters a positive atmosphere where every student feels heard, respected, and valued.
Strong Community and Parental Engagement
OPG believes in building strong ties between students, teachers, and parents. The school conducts regular parent-teacher meetings, feedback sessions, and workshops that keep parents informed and involved in their child's educational journey.
It’s this collaborative model that contributes to OPG's popularity when families search for CBSE schools near me for 11 and 12 Dwarka.
Testimonials from Satisfied Parents and Students
Here’s what some of our students and parents have to say:
“OPG helped me discover my true strengths. The teachers never made me feel pressured and always supported my career goals.” – Ananya Sharma, Class 12 Science (Batch of 2023)
“As a parent, I’m very happy with the school’s balance of academics and values. They treat every child as an individual.” – Rajeev Malhotra, Parent of Class 11 Commerce Student
These stories reflect why so many families consider OPG among the top 10 schools in Dwarka Delhi for senior secondary education.
Admissions Made Easy
OPG World School believes in a transparent and inclusive admission process. Interested students and parents can:
Visit the official school website for registration
Attend orientation and counseling sessions
Take a school tour to explore infrastructure and interact with faculty
Apply via the simple online application form
Seats for classes 11 and 12 fill up quickly due to high demand, so early application is recommended.
Why OPG World School is the Smart Choice for Classes 11 and 12
To summarize, here’s why OPG World School should be your top choice when searching for CBSE schools near me for 11 and 12 Dwarka:
CBSE curriculum with personalized subject choices
Experienced faculty with board and competitive exam expertise
Emphasis on holistic development and leadership
World-class infrastructure with modern tech and labs
Career counseling and university admissions support
Strong values, discipline, and safety culture
Inclusive learning environment with active parental engagement
Whether your child is aiming for top universities, creative pursuits, or competitive exams, OPG provides the foundation for lifelong success.
Final Thoughts
Choosing the right senior secondary school is a decision that shapes your child’s future. As one of the best CBSE schools in Dwarka Delhi, OPG World School continues to be a beacon of excellence and innovation in education. If you’re exploring CBSE 11th and 12th schools Dwarka, don’t miss the opportunity to discover what makes OPG a standout choice.
0 notes
Text
Computer Science with Python: Textbook for CBSE Class 11 [as per 2020-21 curriculum]
Computer Science with Python: Textbook for CBSE Class 11 [as per 2020-21 curriculum]

Price: [price_with_discount] (as of [price_update_date] – Details)
[ad_1]
This latest edition of computer Science with Python for Class XI (083) aims at providing an in-depth understanding of the CBSE curriculum. It strictly adheres to the new revised syllabus for the Academic session 2020-21 and guidelines laid down by the CBSE. This book focuses on teaching Python language to help students…
View On WordPress
0 notes
Link
Class 7 Computer contains necessary information about the course structure and practicals which the students will study in the academic year. NCERT Solution for CBSE Class 7 is considered to be an extremely helpful resource for exam preparation by a thorough understanding of topics and questions. In order to help with CBSE Computer Science syllabus for Class 7, Extramarks provide detailed, step-by-step solutions to all questions in an NCERT textbook. These NCERT solutions will help to prepare for exams with ease.
0 notes
Text
Why NCERT books are most preferable for Government Exams ?
When it comes to prepare for the board exams and score optimum marks, most of the students often waste their time deciding the right study material out of the plenteous options available in the market. Many of the students end up choosing the wrong study materials which may even lead them to failure. National Council of Education, Research and Training (NCERT) has been attributed the role of developing as well as distributing textbooks to the students at primary and secondary level. These books, generally named as NCERT books, are highly useful for the CBSE students as they cover the whole CBSE syllabus for class 1 to 12 and focus on fundamentals to help the students with basic concepts. Explanation: Being the most basic books and written in very simple language, lucid and neutral perspective makes NCERTs as the base for the entire preparation. One will get most of their basic covered for the geography and history from these books. Secondly, mains answer writing language should be similar to the writing style of these books which make them as the fundamental element while preparing for the Mains examination. Now let us analyse from Prelims and Mains perspective: Every year at least 35-40 prelims questions are directly asked from the NCERTs. If you read one book for the prelims it also comes handy in the mains. For Example, Geography NCERTs of class 11 and 12 and History NCERT of class 10 and 11 are the most comprehensive books which must be read by every aspirant. It helps in planned study otherwise, you may be lost in the vast ocean of data and coaching materials. If you are planning to choose humanities optional and you are from the non-humanities background, then study of these books will help in choosing the right optional and further, it may help in your optional paper too. How to read NCERTs? This is the part where one has ample of resources and multiple ways. You may choose whatever suits you the best as per your capability and the planning. For example, One may start with a section such as a history and will read all history NCERTs. Other may move from class 6 NCERTs to Class 7 NCERTs to 8,9,10,11 and finally 12th standard. However, the most optimal way of doing NCERTs is: Underline in the 1st reading. Read and optimise the underlined stuff in the 2nd reading. Make crisp notes of NCERTs in the final reading and from now onwards forget those books and just rely on your notes. Revise them monthly and after 4-5 iterations, you will reach the level that you may require around 4-5hours only to revise entire NCERT books from class 6 to class 12. Always remember, it's not about reading and finishing the books but to remember those concepts, facts then recall them in the prelims and reproduce them in the mains examination. Thus NCERTs must be studied and prepared in such a way that it can be revised in 10-12 hours only. Never give up on the hard work, it will pay off someday if not today. We have bunch of NCERT books are available. All books with their reference link are available below and you can download it for free without any redirection or promotional survey or any kind of distraction. Class 6 Social Science - Social and Political Life 1 Social Science – Our past 1 Mathematics Science Social Science – The earth our Habitat Class 7 Social Science – Our Past – ii Social Science – Our Environment Social Science – Social and Political Life 2 Science Mathematics Class 8 Social History – Our Past 3 Part 1 Social History – Our Past 3 Part 2 Social Geography – Resources and Development Social Science – Social and Political Life 3 Science Mathematics Class 9 Social History – India and the Contemporary World 1 Social Geography – Contemporary India 1 Social Economics – Economics Social Civics – Democratic Politics 1 Science Mathematics Class 10 Social History – India and the Contemporary World 2 Social Geography – Contemporary India 2 Social Economics – Understanding Economic Development Social Civics – Democratic Politics 2 Science Mathematics Class 11 Statistics for Economics Sociology Society – Understanding Society Sociology Introducing Psychology – Introduction to Psychology Political Science – Theory Political Science – Constitution Physics 1 Physics 2 Sociology – Indian Society Mathematics World History – Themes in World History Physical Geography India Physical Environment Economics – Indian Economic Development Computer Communication Chemistry 1 Chemistry 2 Biology Business Study Class 12 Sociology – Social Change and Development in India Sociology – Indian Society Psychology Political Science – Contemporary World Politics Political Science Part 2 Physics Part 1 Physics Part 2 Mathematics 1 Mathematics 2 History – Themes in indian History 1 History – Themes in indian History 2 History – Themes in indian History 3 Geography – Indian people and Economy Geography – Fundamental of Human Geography Economics – Introductory Micro EconomicsEconomics – Introductory Macroeconomics Chemistry Part 1 Chemistry Part 2 Business Studies 1 Business Studies 2 Biology Read the full article
0 notes
Text
NCERT Class 12 Computer Science Chapter 1 Review of Python
NCERT Class 12 Computer Science Python Solutions for Chapter 1 :: Review of Python
TOPIC-1
Python Basics
Very Short Answer Type Questions(1 mark)
Question 1.Name the Python Library modules which need to be imported to invoke the following functions:
load ()
pow () [CBSE Delhi 2016]
Answer:
pickle
math
Question 2.Name the modules to which the following func-tions belong:
Uniform ()
fabs () [CBSE SQP 2016]
Answer:
random ()
math ()
Question 3.Differentiate between the round() and floor() functions with the help of suitable example.[CBSE Comptt. 2016]Answer:The function round() is used to convert a fractional number into whole as the nearest next whereas the function floor() is used convert to the nearest lower whole number, e.g.,round (5.8) = 6, round (4.1) = 5 and floor (6.9) = 6, floor (5.01) = 5
Short Answer Type Questions (2 marks):
Question 1.Out of the following, find those identifiers, which cannot be used for naming Variables or functions in a Python program:Total * Tax, While, Class, Switch, 3rd Row, finally, Column 31, Total. [CBSE Outside Delhi-2016]Answer:Total * Tax, class, 3rd Row, finally
Question 2.Name the Python Library modules which need to be imported to invoke the follwing functions :
sqrt()
dump() (CBSE Outside Delhi-2016)
Answer:
math
pickle
Question 3.Out of the following, find the identifiers, which cannot be used for naming Variable or Functions in a Python program: [CBSE Delhi 2016]_Cost, Price*Qty, float, switch, Address one, Delete, Number12, doAnswer:Price *Qty, float, Address one, do
Question 4.Out of the following find those identifiers, which can not be used for naming Variable or Functions in a Python Program:Days * Rent, For, A_price, Grand Total, do, 2Clients, Participantl, My cityAnswer:Illegal variables or functions name are as below: Days * Rent, do, 2Clients, For and Grant Total Because of being either keyword or including space or operator or starting with integar.
Question 5.Name the function / method required for [CBSE SQP 2015]
Finding second occurrence of m in madam.
get the position of an item in the list.
Answer:
find
index
Question 6.Which string method is used to implement the following:
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character. [CBSE TextBook]
Answer:
len(str)
str.capitalize()
ch.isalnum()
str.upper()
str.replace(old,new)
Question 7.What is the difference between input() and raw_input()?Answer:raw_input() takes the input as a string whereas input() basically looks at what the user enters, and automatically determines the correct type. We use the inputQ function when you are expecting an integer from the end-user, and raw_input when you are expecting a string.
Question 8.What are the two ways of output using print()?Answer:Ordinarily, each print statement produces one line of output. You can end the print statement with a trailing ’ to combine the results of multiple print statements into a single line.
Question 9.Why does the expression 2 + 3*4 result in the value 14 and not the value 24?Answer:Operator precedence rules* make the expression to be interpreted as 2 + (3*4) hence the result is 14.
Question 10.How many times will Python execute the code inside the following while loop? You should answer the question without using the interpreter! Justify your answers.
i = 0 while i < 0 and i > 2 : print “Hello ...” i = i+1
Answer:0 times.
Question 11.How many times will Python execute the code inside the following while loop?
i = 1 while i < 10000 and i > 0 and 1: print “ Hello ...” i = 2 * i
Answer:14.
Question 12.Convert the following for loop into while loop, for i in range (1,100):
if i % 4 == 2 : print i, “mod”, 4 , “= 2”
Answer:
i=1 while i < 100: if i % 4 == 2: print i, “mod”, 4 , “= 2” i = i +1
Question 13.Convert the following for loop into while loop.
for i in range(10): for j in range(i): print '$', print"
Answer:
i=0 while i < 10: j=0 while j < i: print '$’ print"
Question 14.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(25,500,25): print a
Answer:
a=25 while a < 500: print a a = a + 25
Question 15.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(90, 9, -9): print a
Answer:
a = 90 while a > 9: print a a = a-9
Question 16.Convert the following while loop into for loop:
i = 0 while i < 100: if i % 2 == 0: print i, “is even” else: print i, “is odd” i = i + 1
Answer:
for i in range(100): if i % 2 == 0: print i, “is even” else : print i, “is odd”
Question 17.Convert the following while loop into for loop
char = "" print “Press Tab Enter to stop ...” iteration = 0 while not char == “\t” and not iteration > 99: print “Continue?” char = raw_input() iteration+ = 1
Answer:
char = "" print “Press Tab Enter to stop ...” for iteration in range(99): if not char == ‘\t’: print “Continue?” char = raw_input()
Question 18.Rewrite the following while loop into for loop:
i = 10 while i<250: print i i = i+50
Answer:
for i in range(10, 250, 50): print i
Question 19.Rewrite the following while loop into for loop:
i=88 while(i>=8): print i i- = 8
Answer:
for i in range(88, 9, -8) print i
Question 20.Write for statement to print the series 10,20,30, ……., 300Answer:
for i in range(10, 301, 10): print i
Question 21.Write for statement to print the series 105,98,91,… .7Answer:
for i in range(105, 8, -7): print i
Question 22.Write the while loop to print the series: 5,10,15,…100Answer:
i=5 while i <= 100: print i i = i + 5
Question 23.How many times is the following loop executed? [CBSE Text Book]for a in range(100,10,-10):print aAnswer:9 times.
Question 24.How many times is the following loop executed? [CBSE Text Book]
i = 100 while (i<=200): print i i + =20
Answer:6 times
Question 25.State whether the statement is True or False? No matter the underlying data type if values are equal returns true,
char ch1, ch2; if (ch1==ch2) print “Equal”
Answer:True. Two values of same data types can be equal.
Question 26.What are the logical operators of Python?Answer:or, and, not
Question 27.What is the difference between ‘/’ and ‘//’ ?Answer:
// is Integer or Floor division whereas / is normal division (eg) 7.0 // 2 → 3.0 7.0/2 → 3.5
Question 28.How can we import a module in Python?Answer:1. using import
Syntax: import[,,...] Example: import math, cmath
2. using from
Syntax: fromimport[, ,.. ,] Example: . from fib. import fib, fib2.
Question 29.What is the difference between parameters and arguments?Answer:
S.No.ParametersArguments1Values provided in function headerValues provided in function call.2(eg) def area (r):—> r is the parameter(eg) def main() radius = 5.0 area (radius)—> radius is the argument
Question 30.What are default arguments?Answer:Python allowes function arguments to have default values; if the function is called without the argument, the argument gets its default value
Question 31.What are keyword arguments?Answer:If there is a function with many parameters and we want to specify only some of them in function call,then value for such parameters can be provided by using their names instead of the positions. These are called keyword argument.
(eg) def simpleinterest(p, n=2, r=0.6) ' def simpleinterest(p, r=0.2, n=3)
Question 32.What are the advantages of keyword arguments?Answer:It is easier to use since we need not remember the order of the arguments.We can specify the values for only those parameters which we want, and others have default values.
Question 33.What does “in” do?Answer:“in” is a membership operator. It evaluates to true if it finds a variable/string in the specified sequence :Otherwise i+evaluates to false.
(eg) S = “Hello World" if “Hell” in S: print “True” will print True.
Question 34.What does “not in” do?Answer:“not in” is a membership operator. It evaluates to true if it does not finds a variable/stringin the specified sequence. Otherwise it evaluates to false,
(eg) S = “Hello World” if “Hell” not in S: print “False” will print False.
Question 35.What does “slice” do?Answer:The slice[n:m] operator extracts subparts from a string. It doesn’t include the character at index m.
(eg) S = “Hello World” print s[0:4] → Hell
Question 36.What is the use of negative indices in slicing?Answer:Python counts from the end (right) if negative indices are given.
(eg) S = “Hello” print S[:-3] >> He print S[-3:] >> llo
Question 37.Explain find() function?Answer:find (sub[,start[,end]])This function is used to search the first occurrence of the substring in the given string.It returns the index at which the substring starts. It returns -1 if the substring doesn’t occur in the string.
(eg) str = “computer” - str.findf("om”) → 1
Question 38.What are the differences between arrays and lists?Answer:An array holds fixed number of values. List is of variable-length – elements can be dynamically added or removedAn array holds values of a single type. List in Python can hold values of mixed data type.
Question 39.What is the difference between a tuple and a list?Answer:A tuple is immutable whereas a list is a mutable.A tuple cannot be changed whereas a list can be changed internally.A tuple uses parenthess (()) whereas a list uses square brackets ([]).tuple initialization: a = (2, 4, 5)list initialization: a = [2, 4, 5]
Question 40.Carefully observe the following python code and answer the question that follows:x=5def func2():x=3global xx=x+1print xprint xOn execution the above code produces the following output.63Explain the output with respect to the scope of the variables.Answer:Names declared with global keyword have to be referred at the file level. This is because the global scope.If no global statement is being used the variable with the local scope is accessed.Hence, in the above code the statement succeeding the statement global x informs Python to incrementthe global variable xHence, the output is 6 i.e. 5 + 1 which is also the value for global x.When x is reassingned with the value 3 the local x hides the global x and hence 3 printed.(2 marks for explaning the output) (Only 1 mark for explaining global and local namespace.)
Question 41.Explain the two strategies employed by Python for memory allocation. [CBSE SQP 2016]Answer:Pythonuses two strategies for memory allocation-(i) Reference counting(ii) Automatic garbage collectionReference Counting: works by counting the number of times an object is referenced by other in the system.When an object’s reference count reaches zero, Python collects it automatically.Automatic Garbage Collection: Python schedules garbage collection based upon a threshold of object allocations and object deallocations. When the number of allocations minus the number of deallocations are greater that the threshold number, the garbage collector is run and the unused blocks of memory is reclaimed.
TOPIC – 2Writing Python Programs
Question 1.Rewrite the following code in Python after removing all syntax errors(s). Underline each correction done in the code. [CBSE Delhi-2016]for Name in [Amar, Shveta, Parag]if Name [0] = ‘s’:Print (Name)Answer:
for Name in [“_Amar”, ”_Shveta_” , "_Parag_”] : if Name [0] E == ‘S’ : Print (Name)
Question 2.Rewrite the following code is Python after removing all syntax errors(s).Underline each correction done in the code. [CBSE Outside Delhi-2016]for Name in [Ramesh, Suraj, Priya]if Name [0] = ‘S’:Print (Name)Answer:
for Name in [“_Ramesh_”, “_Suraj_” , “_Priya_”] if Name [0] =_=‘S’ : print (Name)
Question 3.What will be the output of the following python code considering the following set of inputs?AMARTHREEA1231200Also, explain the try and except used in the code.Start = 0while True :Try:Number = int (raw input (“Enter Number”))breakexcept valueError : start=start+2print (“Re-enter an integer”)Print (start)Answer:Output:
Enter Number AMAR Re-enter an integer Enter Number THREE Re-enter an integer Enter Number A123 Re-enter an integer Enter Number 12006
Explanation : The code inside try makes sure that the valid number is entered by the user.When any input other an integer is entered, a value error is thrown and it prompts the user to enter another value.
Question 4.Give the output of following with justification. [CBSE SQP 2015]
x = 3 x+ = x-x print x
Answer:Output: 3Working:
x = 3 x = (x+ x-x ):x = 3 + 3 - 3 = 3
Question 5.What will be printed, when following Python code is executed? [CBSE SQP 2015]
class person: def init (self,id): self.id = id arjun = person(150) arjun. diet [‘age’] = 50 print arjun.age + len(arjun. diet )
Justify your answer.Answer:52arjun.age = 50arjun.dict has 2 attributes so length of it is 2. So total = 52.
Question 6.What would be the output of the following code snippets?print 4+9print “4+9”Answer:13 (addition), 49 (concatenation).
Question 7.Highlight the literals in the following programand also predict the output. Mention the types ofvariables in the program.
a=3 b='1' c=a-2 d=a-c e=“Kathy” f=‘went to party.’ g=‘with Sathy’ print a,g,e,f,a,g,“,”,d,g,“,”,c,g,“and his”,e,f
Answer:a, c,d = integerb, e,f,g = stringOutput: 3 with Sathy Kathy, went to party. 3 with Sathy, 2 with Sathy , 1 with Sathy and his Kathy, went to party.
Question 8.What is the result of 4+4/2+2?Answer:4 + (4/2) + 2 = 8.
Question 9.Write the output from the following code: [CBSE Text Book]
x= 10 y = 20 if (x>y): print x+y else: print x-y
Answer:– 10
Question 10.Write the output of the following code:print “Python is an \n interpreted \t Language”Answer:Python is an interpreted Language
Question 11.Write the output from the following code:
s = 0 for I in range(10,2,-2): s+=I print “sum= ",s
Answer:sum= 28
Question 12.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 13.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 14.Observe the following program and answer the question that follows:import randomx = 3N = random, randint (1, x)for 1 in range (N):print 1, ‘#’, 1 + 1a. What is the minimum and maximum number of times the loop will execute?b. Find out, which line of output(s) out of (i) to (iv) will not be expected from the program?i. 0#1ii. 1#2iii. 2#3iv. 3#4Answer:a. Minimum Number = 1Maximum number = 3b. Line iv is not expected to be a part of the output.
Question 15.Observe the following Python code carefully and obtain the output, which will appear on the screen after execution of it. [CBSE SQP 2016]
def Findoutput (): L = "earn" X = " " count = 1 for i in L: if i in ['a', 'e',' i', 'o', 'u']: x = x + 1. Swapcase () else: if (count % 2 ! = 0): x = x + str (len (L[:count])) else: x = x + 1 count = count + 1 print x Findoutput ()
Answer:EA3n
Question 16.Find and write the output of the following Python code:
Number = [9,18,27,36] for N in Numbers: print (N, "#", end = " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1#001#(1#)(1#)2#(1#)(1#2#)1#(2#)(1#2#3#)2#(1#)1#3#(2#)1#2#(3#)1#2#3#
Question 17.What are the possible outcome(s) executed from the following code? Also,specify the maximum and import random. [CBSE Delhi 2016]
PICK=random.randint (0,3) CITY= ["DELHI", "MUMBAI", "CHENNAI", "KOLKATA"]; for I in CITY : for J in range (1, PICK) print (I, end = " ") Print ()
(i)(ii)DELHIDELHIDELHIMUMBAIMUMBAIDELHIMUMBAICHENNAICHENNAIDELHIMUMBAICEHNNAIKOLKATAKOLKATA(iii)(iv)DELHIDELHIMUMBAIMUMBAIMUMBAICHENNAIKOLKATAKOLKATAKOLKATAKOLKATA
Answer:Option (i) and (iii) are possible option (i) onlyPICKER maxval = 3 minval = 0
Question 18.Find and write the output of the following Python code : [CBSE Outside Delhi-2016]
Values = [10,20,30,40] for val in Values: for I in range (1, Val%9): print (I," * ", end= " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1*001*(1.*)(1*)2*0(1*2*)1*(1,*)(1*2*3*)2*(2.*)1*3*01*2*(1.*)1*2*3*(2,* )(3,* )
Question 19.Write the output from the following code:
y = 2000 if (y%4==0): print “Leap Year” else: print “Not leap year”
Answer:Leap Year.
Question 20.What does the following print?
for i in range (1,10): for j in'range (1,10): print i * j, print
Answer:1 2 3 4 5 6 7 8 92 4 6 8 10 12 14 16 183 6 9 12 15 18 21 24 274 8 12 16 20 24 28 32 365 10 15 20 25 30 35 40 456 12 18 24 30 36 42 48 547 14 21 28 35 42 49 56 638 16 24 32 40 48 56 64 729 18 27 36 45 54 63 72 81
Question 21.What will be the output of the following statement? Also, justify the answer.
>> print ‘Radhsa’s dress is pretty’.
Answer:SyntaxError: invalid syntax.The single quote needs to be replaced by V to get the expected output.
Question 22.Give the output of the following statements :
>>> str=‘Honesty is the best policy’ >>> str.replace(‘o’,‘*’)
Answer:‘H*nesty is the best p*licy’.
Question 23.Give the output of the following statements :
>> str=‘Hello Python’ >>> str.istitle()
Answer:True.
Question 24.Give the output of the following statements:
>> str=‘Hello Python’ >>> print str.lstrip(“Hel”)
Answer:Hello Python
Question 25.Write the output for the following codes:
A={10:1000,20:2000,30:3000,40:4000,50:5000} print A.items() print A.keys() print A.values()
Answer:[(40,4000), (10,1000), (20,2000), (50,5000), (30,3000)] [40,10, 20, 50, 30] [4000,1000, 2000, 5000, 3000]
Question 26.Write the output from the following code:
t=(10,20,30,40,50) print len(t)
Answer:5
Question 27.Write the output from the following code:
t=(‘a’,‘b’,‘c’,‘A’,‘B’) print max(t) print min(t)
Answer:‘c’A’
Question 28.Find the output from the following code:
T=(10,30,2,50,5,6,100,65) print max(T) print min(T)
Answer:1002
Question 29.Write the output from the following code:
T1=(10,20,30,40,50) T2 =(10,20,30,40,50) T3 =(100,200,300) cmp(T1, T2) cmp(T2,T3) cmp(T3,T1)
Answer:0-11
Question 30.Write the output from the following code:
T1=(10,20,30,40,50) T2=(100,200,300) T3=T1+T2 print T3
Answer:(10,20,30,40,50,100,200,300)
Question 31.Find the output from the following code:
t=tuple() t = t +(‘Python’,) print t print len(t) t1=(10,20,30) print len(t1)
Answer:(‘Python’,)13
Question 32.Rewrite the following code in Python after remo¬ving all syntax error(s).Underline each correction done in the code.
for student in [Jaya, Priya, Gagan] If Student [0] = ‘S’: print (student)
Answer:for studednt in values [“Jaya”, “Priya”, “Gagan”]:if student [0] = = “S”print (student)
Question 33.Find and write the output of the following Python code:
Values = [11, 22, 33, 44] for V in Values: for NV in range (1, V%10): print (NV, V)
Answer:1, 112,223,334, 44
Question 34.What are the possible outcome(s) executed from the following code? Also, specify the maximum and minimum values that can be assigned to variable SEL.
import random SEL=random. randint (0, 3) ANIMAL = [“DEER”, “Monkey”, “COW”, “Kangaroo”]; for A in ANIMAL: for AAin range (1, SEL): print (A, end =“”) print ()
(i)(ii)(iii)(iv)DEERDEERDEERDEERDEERMONKEYMONKEYDELHIMONKEYMONKEYMONKEYMONKEYCOWCOWDELHIMONKEYCOWCOWKANGAROOKANGAROOKANGAROOKANGAROOKANGAROOKANGAROO
Answer:Maximum value of SEL is 3.The possible output is belowDEERMonkey MonkeyKangaroo Kangaroo KangarooThus (iv) is the correct option.
TOPIC-3Random Functions
Question 1.What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to variable PICKER. [CBSE Outside Delhi-2016]
import random PICKER = random randint (0, 3) COLOR = ["BLUE", "PINK", "GREEN", "RED"]: for I in COLOR : for J in range (1, PICKER): Print (I, end = " ") Print ()
(i)(ii)(iii) (iv)BLUEBLUEPINKSLUEBLUEPINKBLUEPINKPINKGREENPINKPINKGREENBLUEPINKGREENGREENREDGREENGREENREDBLUEPINKGREENREDREDRED
Answer:Option (i) and (iv) are possibleORoption (i) onlyPICKER maxval = 3 minval = 0
Question 2.What are the possible outcome(s) expected from the following python code? Also specifymaximum and minimum value, which we can have. [CBSE SQP 2015]
def main(): p = ‘MY PROGRAM’ i = 0 while p[i] != ‘R’: l = random.randint(0,3) + 5 print p[l],’-’, i += 1
(i) R – P – O – R –(ii) P – O – R – Y –(iii) O -R – A – G –(iv) A- G – R – M –Answer:Minimum value=5Maximum value=8So the only possible values are O, G, R, AOnly option (iii) is possible.
TOPIC-4Correcting The Errors
Question 1.Rewrite the following Python code after removing all syntax error(s). Underline the corrections done.[CBSE SQP 2015]
def main(): r = raw-input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ” + a
Answer:
def main (): r = raw_input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ”, a
Question 2.Rectify the error (if any) in the given statements.
>> str=“Hello Python” >>> str[6]=‘S’
Answer:
str[6] = ‘S’ is incorrect ‘str’ object does not support item assignment. str.replace(str[6],‘S’).
Question 3.Find the errors from the following code:T=[a,b,c]print TAnswer:NameError: name ‘a’ is not defined .T=[‘a’,‘b’,‘c’]
Question 4.Find the errors from the following code:for i in 1 to 100:print IAnswer:for i in range (1,100):print i
Question 5.Find the errors from the following code:
i=10 ; while [i<=n]: print i i+=10
Answer:
i=10 n=100 while (i<=n): print i i+=10
Question 6.Find the errors from the following code:
if (a>b) print a: else if (a<b) print b: else print “both are equal”
Answer:
if (a>b) // missing colon print a: else if (a<b) // missing colon // should be elif print b: else // missing colon print “both are equal"
Question 7.Find errors from the following codes:
c=dict() n=input(Enter total number) i=1 while i<=n: a=raw_input(“enter place”) b=raw_input(“enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[a[i]]
Answer:
c=dict() n=input(‘‘Enter total number”) i=1 while i<=n : a=raw_input(“enter place”) b=raw_inputf enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[i]
Question 8.Observe the following class definition and answer the question that follows : [CBSE SQP 2016]
class info: ips=0 def _str_(self): #Function 1 return "Welcome to the Info Systems" def _init_(Self): self. _ Sstemdate= " " self. SystemTime = " " def getinput (self): self . Systemdate = raw_input ("enter data") self , SystemTime = raw_Input ("enter data") Info, incrips () Estaiomethod # Statement 1 def incrips (): Info, ips, "times" I = Info () I. getinput () Print I. SystemTime Print I. _Systemdate # Statement 2
i. Write statement to invoke Function 1.ii. On Executing the above code, Statement 2 is giving an error explain.Answer:i. print Iii. The statement 2 is giving an error because _ Systemdate is a private variable and hence cannot to be printed outside the class.
TOPIC – 5Short Programs
Question 1.Write a program to calculate the area of a rectangle. The program should get the length and breadth ;values from the user and print the area.Answer:
length = input(“Enter length”) breadth = input(“Enter breadth”) print “Area of rectangle =”,length*breadth
Question 2.Write a program to calculate the roots of a quadratic equation.Answer:
import math a = input(“Enter co-efficient of x^2”) b = input(“Enter co-efficient of x”) c = inputfEnter constant term”) d = b*b - 4*a*c if d == 0: print “Roots are real and equal” root1 = root2 = -b / (2*a) elif d > 0: print “Roots are real and distinct” root1 = (- b + math.sqrt(d)) / (2*a) root2 = (-b - math.sqrt(d)) / (2*a) else: print “Roots are imaginary” print “Roots of the quadratic equation are”,root1,“and”,root2
Question 3.Write a program to input any number and to print all the factors of that number.Answer:
n = inputfEnter the number") for i in range(2,n): if n%i == 0: print i,“is a factor of’.n
Question 4.Write a program to input ,.any number and to check whether given number is Armstrong or not.(Armstrong 1,153,etc. 13 =1, 13+53 +33 =153)Answer:
n = inputfEnter the number”) savedn = n sum=0 while n > 0: a = n%10 sum = sum + a*a*a n = n/10 if savedn == sum: print savedn,“is an Armstrong Number” else: print savedn,”is not an Armstrong Number”
Question 5.Write a program to find all the prime numbers up to a given numberAnswer:
n = input("Enter the number”) i = 2 flag = 0 while (i < n): if (n%i)==0: flag = 1 print n,“is composite” break i = i+ 1 if flag ==0 : print n,“is prime”
Question 6.Write a program to convert decimal number to binary.Answer:
i=1 s=0 dec = int ( raw_input(“Enter the decimal to be converted:”)) while dec>0: rem=dec%2 s=s + (i*rem) dec=dec/2 i=i*10 print “The binary of the given number is:”,s raw_input()
Question 7.Write a program to convert binary to decimalAnswer:
binary = raw_input(“Enter the binary string”) decimal=0 for i in range(len(str(binary))): power=len (str (binary)) - (i+1) decimal+=int(str(binary)[i])*(2**power) print decimal
Question 8.Write a program to input two complex numbers and to find sum of the given complex numbers.Answer:
areal = input("Enter real part of first complex number”) aimg = input("Enter imaginary part of first complex number”) breal = input("Enter real part of second complex number”) bimg = input("Enter imaginary part of second complex number”) totreal = areal + breal totimg = aimg + bimg print “Sum of the complex numbers=",totreal, “+i”, totimg
Question 9.Write a program to input two complex numbers and to implement multiplication of the given complex numbers.Answer:
a = input("Enter real part of first complex number”) b = input("Enter imaginary part of first complex number”) c = input("Enter real part of second complex number”) d = input("Enter imaginary part of second complex number”) real= a*c - b*d img= a*d + b*c print “Product of the complex numbers=",real, “+i”,img
Question 10.Write a program to find the sum of all digits of the given number.Answer:
n = inputfEnter the number”) rev=0 while (n>0): a=n%10 sum = sum + a n=n/10 print “Sum of digits=”,sum
Question 11.Write a program to find the reverse of a number.Answer:
n = input("Enter the number”) rev=0 while (n>0): a=n%10 rev=(rev*10)+a n=n/10 print “Reversed number=”,rev
Question 12.Write a program to print the pyramid.12 23 3 34 4 4 45 5 5 5 5Answer:
for i in range(1,6): for j in range(1,i+1): print i, print
Question 13.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(username.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 14.Write a generator function generatesq () that displays the squareroots of numbers from 100 to nwhere n is passed as an argument.Answer:
import math def generatesq (n) : for i in range (100, n) : yield (math, sqrt (i))
Question 15.Write a method in Python to find and display the prime number between 2 to n.Pass n as argument to the method.Answer:
def prime (N) : for a in range (2, N): for I in range (2, a): if N%i ==0 : break print a OR def prime (N): for a in range (2, N): for I in range (2, a) : if a%1= = 0 : break else : print a
Question 16.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(usemame.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 17.Which string method is used to implement the following: [CBSE Text Book]
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character.
Answer:
len(str)
str.title() or str.capitalize()
str.isalpha and str.isdigit()
lower(str[i])
str.replace(char, newchar)
Question 18.Write a program to input any string and to find the number of words in the string.Answer:
str = “Honesty is the best policy” words = str.split() print len(words)
Question 19.Write a program to input n numbers and to insert any number in a particular position.Answer:
n=input(“Enter no. of values") num=[] for i in range (n): number=input(“Enter the number") num.append(number) newno = input(“Enter the number to be inserted”) pos = input(“Enter position”) num.insert(newno,pos) print num
Question 20.Write a program to input n numbers and to search any number from the list.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) search = input(“Enter number to be searched") for i in range(n): if num[i]==search: print search,“found at position”,i flag=1 if flag==0: print search, “not found in list”
Question 21.Write a program to search input any customer name and display customer phone numberif the customer name is exist in the list.Answer:
def printlist(s): i=0 for i in range(len(s)): print i,s[i] i = 0 phonenumbers = [‘9840012345’,‘9840011111’,’ 9845622222’,‘9850012345’,‘9884412345’] flag=0 number = raw_input(“Enter the phone number to be searched") number = number.strip() try: i = phonenumbers.index(number) if i >= 0: flag=1 except ValueError: pass if(flag <>0): print “\nphone number found in Phonebook at index”, i else: print'\iphonenumbernotfoundin phonebook” print “\nPHONEBOOK” printlist(phonenumbers)
Question 22.Write a program to input n numbers and to reverse the set of numbers without using functions.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) j=n-1 for i in range(n): if i<=n/2: num[i],num[j] = num[j],num[i] j=j-1 else: break print num
Question 23.Find and write the output of the following Python code: [CBSE Complementry-2016]
class Client: def init (self, ID = 1, NM=”Noname”) # constructor self.CID = ID self. Name = NM def Allocate (self, changelD, Title) : self.CID = self.CID + Changeld self.Name = Title + self. Name def Display (self) : print (self. CID). "#”, self. Name) C1 = Client () C2 = Client (102) C3 = Client (205, ‘’Fedrick”) C1 . Display () C2 . Display () C3 . Display () C2 . Allocate (4, "Ms.”) C3 .Allocate (2, "Mr.”) C1. Allocate (1, "Mrs.”) C1. Display () C2 . Display () C3 . Display ()
Answer:
CID Name — Fedrick 102 Mr. Fedrick 205 Mrs. Fedrick — Mr. & Mrs. Fedrick
Question 24.What will be the output of the following Python code considering the following set of inputs?
MAYA Your 5 Apples Mine2 412 Also, explain the try and except used in the code. Count = 0 while True : try: Number=int (raw input ("Input a Number :")) break Except valueError : Count=Count + 2 # For later versions of python, raw_input # Should be consider as input
mehtods:– DenCal () # Method to calcualte Density as People/Area– Add () # Method to allow user to enter values Dcode, DName, People, Area and Call DenCal () Mehtod– View () # Method to display all the data members also display a message “”High Population”if the Density is more than 8000.Answer:Output is below2 Re Enter Number10 Re Enter Number5 Input = Number3 Input = numberTry and except are used for handling exception in the Pythan code.
Question 25.Write a method in Python and display the prime numbers between 2 to N. Pass as argument to the methods.Answer:
def prime (N) : for a in range (2, N) Prime=1 for I in range (2, a): if a%i= = 0 : Prime = 0 if Prime = = 1: print a OR def prime (N) : for a in range (2, N): for I in range (2, a) : if a%i = = 0: break else : print a OR Any other correct code performing the same
Long Answer Type Questions (6 marks)
Question 1.Aastha wnats to create a program that accepts a string and display the characters in the reversein the same line using a Stack. She has created the following code, help her by completing thedefinitions on the basis of requirements given below:[CBSE SQP 2016]
Class mystack : def inin (self): selfe. mystr= # Accept a string self.mylist= # Convert mystr to a list # Write code to display while removing element from the stack. def display (self) : : :
Answer:
class mystack : def _init_ (self) : self.myster= rawjnput ("Enter the string”) self.mylist = list (self.mystr) def display (self) : x = len (self. mylist) if (x > 0) : for i in range (x) : print self.mylist.pop (), else : print "Stack is empty”
via Blogger https://ift.tt/3kkMk05
0 notes
Text
How OPG World School Redefines Top Schools in Dwarka!
When it comes to choosing the top schools in Dwarka, parents seek institutions that offer a blend of academic excellence, holistic development, and modern facilities. Dwarka, a thriving educational hub in Delhi, is home to numerous schools that cater to diverse needs, from preschool to senior secondary education. Among these, OPG World School emerges as a standout choice, consistently ranking among the top schools in Dwarka for its innovative teaching methods, state-of-the-art infrastructure, and commitment to nurturing well-rounded individuals. This article explores why OPG World School is a preferred option for parents searching for the best CBSE schools in Dwarka, Delhi, and provides insights into the educational landscape of the region.
The Educational Landscape of Dwarka
Dwarka, often referred to as Delhi’s “second capital,” is a vibrant sub-city with a reputation for hosting some of the finest educational institutions in the capital. With over 60 schools offering a range of curricula, including CBSE, ICSE, and international boards, Dwarka caters to families seeking quality education for their children. The area’s strategic location, excellent connectivity, and well-planned infrastructure make it an ideal place for families to settle, further driving the demand for top 10 schools in Dwarka, Delhi.
Parents looking for CBSE schools near me for 11 and 12 in Dwarka or pre-schools in Dwarka have a plethora of options. However, selecting the right school involves evaluating factors such as academic rigor, extracurricular opportunities, faculty expertise, and campus facilities. OPG World School excels in all these areas, making it a top contender in the top 10 schools in Dwarka list.
Why Choose OPG World School?
Located in the heart of Dwarka, OPG World School is a CBSE-affiliated institution that has earned a stellar reputation for its student-centric approach and commitment to excellence. Here’s why it stands out among the best CBSE schools in Dwarka, Delhi:
1. Comprehensive CBSE Curriculum
OPG World School offers a robust CBSE curriculum that caters to students from preschool to Class 12. For parents searching for CBSE 11th and 12th schools in Dwarka, OPG provides specialized streams in Science, Commerce, and Humanities, ensuring students are well-prepared for competitive exams like JEE, NEET, and CLAT. The school’s focus on conceptual clarity, practical learning, and regular assessments helps students excel academically while fostering critical thinking and problem-solving skills.
2. Holistic Development
Education at OPG World School goes beyond textbooks. The school emphasizes holistic development through a balanced mix of academics, sports, arts, and co-curricular activities. From dance and music studios to well-equipped sports facilities, students have ample opportunities to explore their talents and passions. This approach aligns with the expectations of parents seeking top 10 schools in Dwarka Mor that nurture well-rounded individuals.
3. State-of-the-Art Infrastructure
OPG World School boasts a sprawling campus with modern facilities, including smart classrooms, advanced science and computer labs, a well-stocked library, and dedicated spaces for extracurricular activities. The campus is designed to create a safe, inclusive, and stimulating environment, making it a top choice for admission for KG in Dwarka and higher classes.
4. Experienced Faculty
The backbone of any great school is its faculty, and OPG World School prides itself on its team of highly qualified and dedicated educators. Teachers employ innovative teaching methodologies, such as project-based learning and technology integration, to make lessons engaging and effective. This is particularly beneficial for students in CBSE schools near me for 11 and 12 in Dwarka, where personalized guidance is crucial for board exam preparation.
5. Focus on Early Education
For parents seeking pre-schools in Dwarka, OPG World School offers a nurturing environment for young learners. The preschool program is designed to foster creativity, curiosity, and social skills through play-based learning and interactive activities. The school’s emphasis on early childhood education ensures a strong foundation for future academic success, making it a preferred choice for admission for KG in Dwarka.
Comparing OPG World School with Other Top Schools in Dwarka
To understand why OPG World School ranks among the top 10 schools in Dwarka, Delhi, let’s compare it with other prominent institutions in the area:
Delhi Public School (DPS), Dwarka: Known for its academic excellence and strong extracurricular programs, DPS Dwarka is a top contender. However, OPG World School offers a more personalized learning experience with a lower student-teacher ratio, ensuring individual attention.
Venkateshwar International School: This school is praised for its modern facilities and global outlook. OPG matches these standards while offering a unique focus on life skills and emotional intelligence, preparing students for real-world challenges.
Mount Carmel School, Dwarka: Mount Carmel is recognized for its supportive environment. OPG World School complements this with cutting-edge infrastructure and a broader range of co-curricular activities.
The Indian Heights School: A strong player in the top 10 schools in Dwarka list, this school emphasizes creativity. OPG World School stands out with its comprehensive CBSE curriculum and specialized programs for senior secondary students.
While each of these schools has its strengths, OPG World School’s balanced approach to academics, extracurriculars, and personal growth makes it a top choice for parents seeking CBSE 11th and 12th schools in Dwarka or early education programs.
Admission Process at OPG World School
Securing a spot at one of the top schools in Dwarka like OPG World School requires understanding the admission process. Here’s a step-by-step guide:
Online Registration: Visit the school’s official website to fill out the online registration form. Ensure you provide accurate details, including the child’s age, previous academic records, and preferred class.
Document Submission: Submit necessary documents, such as the child’s birth certificate, Aadhar card, residence proof, and previous report cards. For admission for KG in Dwarka, additional documents like vaccination records may be required.
Interaction/Assessment: Depending on the class, the school may conduct an interaction session for preschool applicants or an entrance test for higher classes. This helps assess the child’s readiness and fit for the school’s curriculum.
Fee Payment: Once selected, parents must complete the fee payment process to confirm admission. OPG World School offers a transparent fee structure, ensuring value for money.
The admission process for the 2025-26 academic session is expected to begin in November 2024, aligning with Delhi’s nursery admission timeline. Parents are advised to stay updated via the school’s website to avoid missing deadlines.
Why Dwarka is a Hub for Quality Education
Dwarka’s reputation as an educational hub is driven by its diverse range of schools, from pre-schools in Dwarka to senior secondary institutions. The area’s well-planned sectors, such as Sector 10, Sector 12, and Dwarka Mor, host numerous CBSE-affiliated schools, making it convenient for parents to find CBSE schools near me for 11 and 12 in Dwarka. Additionally, Dwarka’s proximity to central Delhi and excellent public transport connectivity make it an attractive location for families.
The presence of schools like OPG World School, which combine academic rigor with modern facilities, further elevates Dwarka’s status. Whether you’re looking for top 10 schools in Dwarka Mor or institutions offering specialized programs for senior secondary students, Dwarka has something for everyone.
Tips for Choosing the Right School in Dwarka
With so many options among the top schools in Dwarka, selecting the right one can be overwhelming. Here are some tips to guide parents:
Define Your Priorities: Decide whether you prioritize academic excellence, extracurricular activities, or a specific curriculum like CBSE. For instance, if you’re seeking CBSE 11th and 12th schools in Dwarka, ensure the school offers strong board exam preparation.
Visit the Campus: Schedule a visit to assess the infrastructure, safety measures, and learning environment. OPG World School welcomes parents to tour its campus and interact with faculty.
Check Reviews and Rankings: Research online reviews and rankings, such as the top 10 schools in Dwarka list, to gauge the school’s reputation. OPG World School consistently receives positive feedback for its holistic approach.
Evaluate Faculty: A school’s faculty plays a crucial role in shaping a child’s future. OPG’s experienced educators are a key reason it ranks among the best CBSE schools in Dwarka, Delhi.
Consider Proximity: For younger children, proximity is important. OPG World School’s central location in Dwarka makes it accessible for families across the sub-city.
Conclusion
Choosing the right school is a critical decision that shapes a child’s future. Among the top schools in Dwarka, OPG World School stands out for its comprehensive CBSE curriculum, modern facilities, and commitment to holistic development. Whether you’re searching for pre-schools in Dwarka, CBSE schools near me for 11 and 12 in Dwarka, or a nurturing environment for KG admission, OPG World School offers a compelling blend of academic excellence and personal growth opportunities.As Dwarka continues to solidify its position as an educational hub, OPG World School remains a beacon of quality education, preparing students to excel in a dynamic world. For parents seeking the best CBSE schools in Dwarka, Delhi, OPG World School is a name that deserves serious consideration. Visit their website today to explore admission details and take the first step toward securing a bright future for your child.
0 notes
Text
OPG World School – Best CBSE School for 11th and 12th
Choosing the right school for Class 11 and 12 is a critical decision that shapes a student’s academic journey and future career path. For students and parents searching for CBSE schools near me for 11 and 12 Dwarka, OPG World School emerges as the best choice. Situated in the heart of Dwarka, Delhi, OPG World School stands out as one of the best CBSE schools in Dwarka Delhi, offering a world-class education aligned with holistic development, academic excellence, and future readiness.
Whether you're looking for the top 10 schools in Dwarka Delhi, or want to enroll your child in an institution known for nurturing talent and building strong academic foundations, OPG World School deserves your attention. This article explores why OPG World School is considered the best CBSE school for 11th and 12th in Dwarka.
Why Choose CBSE Curriculum for Class 11 and 12?
The Central Board of Secondary Education (CBSE) is one of the most trusted and widely accepted education boards in India. The CBSE curriculum is known for:
Its structured and national-level syllabus
Focus on conceptual learning and application-based questions
Alignment with competitive exams like JEE, NEET, CUET, etc.
Stress-free learning with activity-based assessments
Standardization across India
For parents looking for CBSE 11th and 12th schools in Dwarka, choosing a reputed institution like OPG World School ensures that their children are in an environment that encourages academic brilliance and personal growth.
OPG World School: A Glimpse
Located in Sector 19-B, Dwarka, New Delhi, OPG World School has gained a stellar reputation for delivering quality education with a futuristic outlook. With a mission to empower students through knowledge, innovation, and values, the school has become one of the top 10 schools in Dwarka list consistently over the years.
The school offers the CBSE curriculum from Kindergarten to Grade 12, with a strong focus on senior secondary education in Science, Commerce, and Humanities streams.
Academic Excellence in Senior Secondary (11th and 12th)
Customized Stream Selection
At OPG World School, students can choose from a wide range of subject combinations in Science, Commerce, and Humanities streams. The flexibility of choices allows students to tailor their academic plans according to career goals and interests. Each stream is supported by expert faculty members, modern labs, and project-based learning.
Expert Faculty and Mentoring
One of the key reasons why OPG World School is among the top 10 schools in Dwarka Delhi is its highly qualified and experienced faculty. Teachers at OPG go beyond textbooks, offering conceptual clarity, exam strategies, and personal mentoring—especially crucial during the 11th and 12th grades.
Exam Readiness and Career Guidance
OPG World School emphasizes preparation for board exams and beyond. Specialized coaching for competitive exams like JEE, NEET, CLAT, CUET, and others is integrated into the school curriculum. Regular mock tests, doubt-solving sessions, and personalized feedback help students excel in both board and entrance exams.
In addition, the Career Counseling Cell at OPG helps students identify career options, plan for higher education, and apply to top universities in India and abroad.
World-Class Infrastructure Supporting Academic Goals
OPG World School's state-of-the-art campus in Dwarka boasts a modern infrastructure designed for academic and extracurricular excellence. This includes:
Smart classrooms with digital learning tools
Well-equipped Science, Mathematics, and Computer labs
Audio-visual rooms for interactive learning
A well-stocked library with access to digital resources
A spacious auditorium for seminars and cultural events
All these features contribute to creating a learning ecosystem that supports innovation and academic inquiry.
Holistic Development Beyond Academics
At OPG, education isn’t confined to textbooks. The school’s focus on holistic development is another reason it’s listed among the top 10 schools in Dwarka Mor and the greater Dwarka region.
Co-curricular and Extra-curricular Activities
Students participate in a wide range of activities, including:
Music, dance, and theatre
Art and craft
Debates, quizzes, and model UN
Sports and physical education
This holistic approach ensures that students grow into confident, well-rounded individuals who are prepared to lead and innovate.
Values-Driven Education
In a competitive academic environment, values often take a backseat. Not at OPG World School. The institution focuses on character-building, empathy, and leadership. Through value-based education and social responsibility initiatives, students are taught to care for the community and become responsible global citizens.
Focus on Digital Learning and Innovation
In today’s digital era, OPG World School has integrated technology into its teaching-learning processes. The school uses:
Learning Management Systems (LMS) for assignments and assessments
Online learning resources and interactive apps
AI-based performance tracking and analysis
Virtual labs and simulations for Science students
This makes OPG a true 21st-century school, particularly appealing for tech-savvy students in CBSE 11th and 12th schools Dwarka.
Safety, Security, and Wellness
Student safety is of utmost importance at OPG. The school ensures a safe, secure, and inclusive environment through:
CCTV surveillance across the campus
ID card-based entry systems
Trained medical staff and regular health checkups
Student wellness programs and mental health support
Admission Process for Class 11 and 12
OPG World School offers a transparent and merit-based admission process for senior secondary grades. Interested parents searching for CBSE schools near me for 11 and 12 Dwarka or online can visit the school’s website or contact the admission office for details.
Key steps for admission:
Online Application via the school portal
Academic Assessment and personal interaction
Counseling Session for stream and subject selection
Confirmation and Fee Submission
The school welcomes new students from different boards and ensures a smooth transition to the CBSE curriculum.
OPG World School vs. Other CBSE Schools in Dwarka
Let’s understand why OPG World School is often ranked higher among the top 10 schools in Dwarka list:
Feature
OPG World School
Other CBSE Schools
Stream & Subject Flexibility
✓
Limited
Board Exam & Competitive Prep
✓
Varies
Career Counseling & Mentoring
✓
Limited
Modern Infrastructure
✓
✓/✗
Holistic & Values Education
✓
Limited
Faculty Expertise
✓
Varies
Student Wellness & Mental Health
✓
Often Overlooked
Integration of Technology
✓
Partial
OPG from Start to Finish: Admission for KG to Grade 12
While this article focuses on Class 11 and 12, it’s worth noting that OPG World School also ranks high among pre schools in Dwarka. The school offers an enriching Early Years program that promotes curiosity, communication, and foundational learning.
Parents looking for admission for KG in Dwarka can confidently choose OPG, knowing their child will progress through a consistent and high-quality educational journey from kindergarten to senior secondary.
Testimonials from Students and Parents
Ritika Sharma (Class 12 Science) "I joined OPG in Class 11, and it was the best decision ever. The teachers supported me academically and emotionally through every challenge. I’m now preparing for NEET, and I feel confident!"
Mrs. Kanchan Gupta (Parent) "We explored many CBSE schools in Dwarka Delhi, but OPG stood out because of its attention to detail, individual mentoring, and academic rigor. My daughter is now in 12th Commerce and loving the experience."
Conclusion: The Best Destination for Senior Secondary Success
When searching for the best CBSE schools in Dwarka Delhi for senior secondary education, OPG World School consistently tops the list. It’s more than just a school—it's a nurturing environment where students are guided, inspired, and prepared for the future.
Whether you're transitioning into 11th or looking to switch schools for a better Class 12 experience, OPG offers everything you need—academic excellence, personal growth, safety, innovation, and strong values.So the next time you search for CBSE 11th and 12th schools in Dwarka or explore the top 10 schools in Dwarka Mor, let OPG World School be your first choice.

0 notes
Text
NCERT Class 12 Computer Science Chapter 1 Review of Python
NCERT Class 12 Computer Science Python Solutions for Chapter 1 :: Review of Python
TOPIC-1
Python Basics
Very Short Answer Type Questions(1 mark)
Question 1.Name the Python Library modules which need to be imported to invoke the following functions:
load ()
pow () [CBSE Delhi 2016]
Answer:
pickle
math
Question 2.Name the modules to which the following func-tions belong:
Uniform ()
fabs () [CBSE SQP 2016]
Answer:
random ()
math ()
Question 3.Differentiate between the round() and floor() functions with the help of suitable example.[CBSE Comptt. 2016]Answer:The function round() is used to convert a fractional number into whole as the nearest next whereas the function floor() is used convert to the nearest lower whole number, e.g.,round (5.8) = 6, round (4.1) = 5 and floor (6.9) = 6, floor (5.01) = 5
Short Answer Type Questions (2 marks):
Question 1.Out of the following, find those identifiers, which cannot be used for naming Variables or functions in a Python program:Total * Tax, While, Class, Switch, 3rd Row, finally, Column 31, Total. [CBSE Outside Delhi-2016]Answer:Total * Tax, class, 3rd Row, finally
Question 2.Name the Python Library modules which need to be imported to invoke the follwing functions :
sqrt()
dump() (CBSE Outside Delhi-2016)
Answer:
math
pickle
Question 3.Out of the following, find the identifiers, which cannot be used for naming Variable or Functions in a Python program: [CBSE Delhi 2016]_Cost, Price*Qty, float, switch, Address one, Delete, Number12, doAnswer:Price *Qty, float, Address one, do
Question 4.Out of the following find those identifiers, which can not be used for naming Variable or Functions in a Python Program:Days * Rent, For, A_price, Grand Total, do, 2Clients, Participantl, My cityAnswer:Illegal variables or functions name are as below: Days * Rent, do, 2Clients, For and Grant Total Because of being either keyword or including space or operator or starting with integar.
Question 5.Name the function / method required for [CBSE SQP 2015]
Finding second occurrence of m in madam.
get the position of an item in the list.
Answer:
find
index
Question 6.Which string method is used to implement the following:
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character. [CBSE TextBook]
Answer:
len(str)
str.capitalize()
ch.isalnum()
str.upper()
str.replace(old,new)
Question 7.What is the difference between input() and raw_input()?Answer:raw_input() takes the input as a string whereas input() basically looks at what the user enters, and automatically determines the correct type. We use the inputQ function when you are expecting an integer from the end-user, and raw_input when you are expecting a string.
Question 8.What are the two ways of output using print()?Answer:Ordinarily, each print statement produces one line of output. You can end the print statement with a trailing ’ to combine the results of multiple print statements into a single line.
Question 9.Why does the expression 2 + 3*4 result in the value 14 and not the value 24?Answer:Operator precedence rules* make the expression to be interpreted as 2 + (3*4) hence the result is 14.
Question 10.How many times will Python execute the code inside the following while loop? You should answer the question without using the interpreter! Justify your answers.
i = 0 while i < 0 and i > 2 : print “Hello ...” i = i+1
Answer:0 times.
Question 11.How many times will Python execute the code inside the following while loop?
i = 1 while i < 10000 and i > 0 and 1: print “ Hello ...” i = 2 * i
Answer:14.
Question 12.Convert the following for loop into while loop, for i in range (1,100):
if i % 4 == 2 : print i, “mod”, 4 , “= 2”
Answer:
i=1 while i < 100: if i % 4 == 2: print i, “mod”, 4 , “= 2” i = i +1
Question 13.Convert the following for loop into while loop.
for i in range(10): for j in range(i): print '$', print"
Answer:
i=0 while i < 10: j=0 while j < i: print '$’ print"
Question 14.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(25,500,25): print a
Answer:
a=25 while a < 500: print a a = a + 25
Question 15.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(90, 9, -9): print a
Answer:
a = 90 while a > 9: print a a = a-9
Question 16.Convert the following while loop into for loop:
i = 0 while i < 100: if i % 2 == 0: print i, “is even” else: print i, “is odd” i = i + 1
Answer:
for i in range(100): if i % 2 == 0: print i, “is even” else : print i, “is odd”
Question 17.Convert the following while loop into for loop
char = "" print “Press Tab Enter to stop ...” iteration = 0 while not char == “\t” and not iteration > 99: print “Continue?” char = raw_input() iteration+ = 1
Answer:
char = "" print “Press Tab Enter to stop ...” for iteration in range(99): if not char == ‘\t’: print “Continue?” char = raw_input()
Question 18.Rewrite the following while loop into for loop:
i = 10 while i<250: print i i = i+50
Answer:
for i in range(10, 250, 50): print i
Question 19.Rewrite the following while loop into for loop:
i=88 while(i>=8): print i i- = 8
Answer:
for i in range(88, 9, -8) print i
Question 20.Write for statement to print the series 10,20,30, ……., 300Answer:
for i in range(10, 301, 10): print i
Question 21.Write for statement to print the series 105,98,91,… .7Answer:
for i in range(105, 8, -7): print i
Question 22.Write the while loop to print the series: 5,10,15,…100Answer:
i=5 while i <= 100: print i i = i + 5
Question 23.How many times is the following loop executed? [CBSE Text Book]for a in range(100,10,-10):print aAnswer:9 times.
Question 24.How many times is the following loop executed? [CBSE Text Book]
i = 100 while (i<=200): print i i + =20
Answer:6 times
Question 25.State whether the statement is True or False? No matter the underlying data type if values are equal returns true,
char ch1, ch2; if (ch1==ch2) print “Equal”
Answer:True. Two values of same data types can be equal.
Question 26.What are the logical operators of Python?Answer:or, and, not
Question 27.What is the difference between ‘/’ and ‘//’ ?Answer:
// is Integer or Floor division whereas / is normal division (eg) 7.0 // 2 → 3.0 7.0/2 → 3.5
Question 28.How can we import a module in Python?Answer:1. using import
Syntax: import[,,...] Example: import math, cmath
2. using from
Syntax: fromimport[, ,.. ,] Example: . from fib. import fib, fib2.
Question 29.What is the difference between parameters and arguments?Answer:
S.No.ParametersArguments1Values provided in function headerValues provided in function call.2(eg) def area (r):—> r is the parameter(eg) def main() radius = 5.0 area (radius)—> radius is the argument
Question 30.What are default arguments?Answer:Python allowes function arguments to have default values; if the function is called without the argument, the argument gets its default value
Question 31.What are keyword arguments?Answer:If there is a function with many parameters and we want to specify only some of them in function call,then value for such parameters can be provided by using their names instead of the positions. These are called keyword argument.
(eg) def simpleinterest(p, n=2, r=0.6) ' def simpleinterest(p, r=0.2, n=3)
Question 32.What are the advantages of keyword arguments?Answer:It is easier to use since we need not remember the order of the arguments.We can specify the values for only those parameters which we want, and others have default values.
Question 33.What does “in” do?Answer:“in” is a membership operator. It evaluates to true if it finds a variable/string in the specified sequence :Otherwise i+evaluates to false.
(eg) S = “Hello World" if “Hell” in S: print “True” will print True.
Question 34.What does “not in” do?Answer:“not in” is a membership operator. It evaluates to true if it does not finds a variable/stringin the specified sequence. Otherwise it evaluates to false,
(eg) S = “Hello World” if “Hell” not in S: print “False” will print False.
Question 35.What does “slice” do?Answer:The slice[n:m] operator extracts subparts from a string. It doesn’t include the character at index m.
(eg) S = “Hello World” print s[0:4] → Hell
Question 36.What is the use of negative indices in slicing?Answer:Python counts from the end (right) if negative indices are given.
(eg) S = “Hello” print S[:-3] >> He print S[-3:] >> llo
Question 37.Explain find() function?Answer:find (sub[,start[,end]])This function is used to search the first occurrence of the substring in the given string.It returns the index at which the substring starts. It returns -1 if the substring doesn’t occur in the string.
(eg) str = “computer” - str.findf("om”) → 1
Question 38.What are the differences between arrays and lists?Answer:An array holds fixed number of values. List is of variable-length – elements can be dynamically added or removedAn array holds values of a single type. List in Python can hold values of mixed data type.
Question 39.What is the difference between a tuple and a list?Answer:A tuple is immutable whereas a list is a mutable.A tuple cannot be changed whereas a list can be changed internally.A tuple uses parenthess (()) whereas a list uses square brackets ([]).tuple initialization: a = (2, 4, 5)list initialization: a = [2, 4, 5]
Question 40.Carefully observe the following python code and answer the question that follows:x=5def func2():x=3global xx=x+1print xprint xOn execution the above code produces the following output.63Explain the output with respect to the scope of the variables.Answer:Names declared with global keyword have to be referred at the file level. This is because the global scope.If no global statement is being used the variable with the local scope is accessed.Hence, in the above code the statement succeeding the statement global x informs Python to incrementthe global variable xHence, the output is 6 i.e. 5 + 1 which is also the value for global x.When x is reassingned with the value 3 the local x hides the global x and hence 3 printed.(2 marks for explaning the output) (Only 1 mark for explaining global and local namespace.)
Question 41.Explain the two strategies employed by Python for memory allocation. [CBSE SQP 2016]Answer:Pythonuses two strategies for memory allocation-(i) Reference counting(ii) Automatic garbage collectionReference Counting: works by counting the number of times an object is referenced by other in the system.When an object’s reference count reaches zero, Python collects it automatically.Automatic Garbage Collection: Python schedules garbage collection based upon a threshold of object allocations and object deallocations. When the number of allocations minus the number of deallocations are greater that the threshold number, the garbage collector is run and the unused blocks of memory is reclaimed.
TOPIC – 2Writing Python Programs
Question 1.Rewrite the following code in Python after removing all syntax errors(s). Underline each correction done in the code. [CBSE Delhi-2016]for Name in [Amar, Shveta, Parag]if Name [0] = ‘s’:Print (Name)Answer:
for Name in [“_Amar”, ”_Shveta_” , "_Parag_”] : if Name [0] E == ‘S’ : Print (Name)
Question 2.Rewrite the following code is Python after removing all syntax errors(s).Underline each correction done in the code. [CBSE Outside Delhi-2016]for Name in [Ramesh, Suraj, Priya]if Name [0] = ‘S’:Print (Name)Answer:
for Name in [“_Ramesh_”, “_Suraj_” , “_Priya_”] if Name [0] =_=‘S’ : print (Name)
Question 3.What will be the output of the following python code considering the following set of inputs?AMARTHREEA1231200Also, explain the try and except used in the code.Start = 0while True :Try:Number = int (raw input (“Enter Number”))breakexcept valueError : start=start+2print (“Re-enter an integer”)Print (start)Answer:Output:
Enter Number AMAR Re-enter an integer Enter Number THREE Re-enter an integer Enter Number A123 Re-enter an integer Enter Number 12006
Explanation : The code inside try makes sure that the valid number is entered by the user.When any input other an integer is entered, a value error is thrown and it prompts the user to enter another value.
Question 4.Give the output of following with justification. [CBSE SQP 2015]
x = 3 x+ = x-x print x
Answer:Output: 3Working:
x = 3 x = (x+ x-x ):x = 3 + 3 - 3 = 3
Question 5.What will be printed, when following Python code is executed? [CBSE SQP 2015]
class person: def init (self,id): self.id = id arjun = person(150) arjun. diet [‘age’] = 50 print arjun.age + len(arjun. diet )
Justify your answer.Answer:52arjun.age = 50arjun.dict has 2 attributes so length of it is 2. So total = 52.
Question 6.What would be the output of the following code snippets?print 4+9print “4+9”Answer:13 (addition), 49 (concatenation).
Question 7.Highlight the literals in the following programand also predict the output. Mention the types ofvariables in the program.
a=3 b='1' c=a-2 d=a-c e=“Kathy” f=‘went to party.’ g=‘with Sathy’ print a,g,e,f,a,g,“,”,d,g,“,”,c,g,“and his”,e,f
Answer:a, c,d = integerb, e,f,g = stringOutput: 3 with Sathy Kathy, went to party. 3 with Sathy, 2 with Sathy , 1 with Sathy and his Kathy, went to party.
Question 8.What is the result of 4+4/2+2?Answer:4 + (4/2) + 2 = 8.
Question 9.Write the output from the following code: [CBSE Text Book]
x= 10 y = 20 if (x>y): print x+y else: print x-y
Answer:– 10
Question 10.Write the output of the following code:print “Python is an \n interpreted \t Language”Answer:Python is an interpreted Language
Question 11.Write the output from the following code:
s = 0 for I in range(10,2,-2): s+=I print “sum= ",s
Answer:sum= 28
Question 12.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 13.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 14.Observe the following program and answer the question that follows:import randomx = 3N = random, randint (1, x)for 1 in range (N):print 1, ‘#’, 1 + 1a. What is the minimum and maximum number of times the loop will execute?b. Find out, which line of output(s) out of (i) to (iv) will not be expected from the program?i. 0#1ii. 1#2iii. 2#3iv. 3#4Answer:a. Minimum Number = 1Maximum number = 3b. Line iv is not expected to be a part of the output.
Question 15.Observe the following Python code carefully and obtain the output, which will appear on the screen after execution of it. [CBSE SQP 2016]
def Findoutput (): L = "earn" X = " " count = 1 for i in L: if i in ['a', 'e',' i', 'o', 'u']: x = x + 1. Swapcase () else: if (count % 2 ! = 0): x = x + str (len (L[:count])) else: x = x + 1 count = count + 1 print x Findoutput ()
Answer:EA3n
Question 16.Find and write the output of the following Python code:
Number = [9,18,27,36] for N in Numbers: print (N, "#", end = " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1#001#(1#)(1#)2#(1#)(1#2#)1#(2#)(1#2#3#)2#(1#)1#3#(2#)1#2#(3#)1#2#3#
Question 17.What are the possible outcome(s) executed from the following code? Also,specify the maximum and import random. [CBSE Delhi 2016]
PICK=random.randint (0,3) CITY= ["DELHI", "MUMBAI", "CHENNAI", "KOLKATA"]; for I in CITY : for J in range (1, PICK) print (I, end = " ") Print ()
(i)(ii)DELHIDELHIDELHIMUMBAIMUMBAIDELHIMUMBAICHENNAICHENNAIDELHIMUMBAICEHNNAIKOLKATAKOLKATA(iii)(iv)DELHIDELHIMUMBAIMUMBAIMUMBAICHENNAIKOLKATAKOLKATAKOLKATAKOLKATA
Answer:Option (i) and (iii) are possible option (i) onlyPICKER maxval = 3 minval = 0
Question 18.Find and write the output of the following Python code : [CBSE Outside Delhi-2016]
Values = [10,20,30,40] for val in Values: for I in range (1, Val%9): print (I," * ", end= " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1*001*(1.*)(1*)2*0(1*2*)1*(1,*)(1*2*3*)2*(2.*)1*3*01*2*(1.*)1*2*3*(2,* )(3,* )
Question 19.Write the output from the following code:
y = 2000 if (y%4==0): print “Leap Year” else: print “Not leap year”
Answer:Leap Year.
Question 20.What does the following print?
for i in range (1,10): for j in'range (1,10): print i * j, print
Answer:1 2 3 4 5 6 7 8 92 4 6 8 10 12 14 16 183 6 9 12 15 18 21 24 274 8 12 16 20 24 28 32 365 10 15 20 25 30 35 40 456 12 18 24 30 36 42 48 547 14 21 28 35 42 49 56 638 16 24 32 40 48 56 64 729 18 27 36 45 54 63 72 81
Question 21.What will be the output of the following statement? Also, justify the answer.
>> print ‘Radhsa’s dress is pretty’.
Answer:SyntaxError: invalid syntax.The single quote needs to be replaced by V to get the expected output.
Question 22.Give the output of the following statements :
>>> str=‘Honesty is the best policy’ >>> str.replace(‘o’,‘*’)
Answer:‘H*nesty is the best p*licy’.
Question 23.Give the output of the following statements :
>> str=‘Hello Python’ >>> str.istitle()
Answer:True.
Question 24.Give the output of the following statements:
>> str=‘Hello Python’ >>> print str.lstrip(“Hel”)
Answer:Hello Python
Question 25.Write the output for the following codes:
A={10:1000,20:2000,30:3000,40:4000,50:5000} print A.items() print A.keys() print A.values()
Answer:[(40,4000), (10,1000), (20,2000), (50,5000), (30,3000)] [40,10, 20, 50, 30] [4000,1000, 2000, 5000, 3000]
Question 26.Write the output from the following code:
t=(10,20,30,40,50) print len(t)
Answer:5
Question 27.Write the output from the following code:
t=(‘a’,‘b’,‘c’,‘A’,‘B’) print max(t) print min(t)
Answer:‘c’A’
Question 28.Find the output from the following code:
T=(10,30,2,50,5,6,100,65) print max(T) print min(T)
Answer:1002
Question 29.Write the output from the following code:
T1=(10,20,30,40,50) T2 =(10,20,30,40,50) T3 =(100,200,300) cmp(T1, T2) cmp(T2,T3) cmp(T3,T1)
Answer:0-11
Question 30.Write the output from the following code:
T1=(10,20,30,40,50) T2=(100,200,300) T3=T1+T2 print T3
Answer:(10,20,30,40,50,100,200,300)
Question 31.Find the output from the following code:
t=tuple() t = t +(‘Python’,) print t print len(t) t1=(10,20,30) print len(t1)
Answer:(‘Python’,)13
Question 32.Rewrite the following code in Python after remo¬ving all syntax error(s).Underline each correction done in the code.
for student in [Jaya, Priya, Gagan] If Student [0] = ‘S’: print (student)
Answer:for studednt in values [“Jaya”, “Priya”, “Gagan”]:if student [0] = = “S”print (student)
Question 33.Find and write the output of the following Python code:
Values = [11, 22, 33, 44] for V in Values: for NV in range (1, V%10): print (NV, V)
Answer:1, 112,223,334, 44
Question 34.What are the possible outcome(s) executed from the following code? Also, specify the maximum and minimum values that can be assigned to variable SEL.
import random SEL=random. randint (0, 3) ANIMAL = [“DEER”, “Monkey”, “COW”, “Kangaroo”]; for A in ANIMAL: for AAin range (1, SEL): print (A, end =“”) print ()
(i)(ii)(iii)(iv)DEERDEERDEERDEERDEERMONKEYMONKEYDELHIMONKEYMONKEYMONKEYMONKEYCOWCOWDELHIMONKEYCOWCOWKANGAROOKANGAROOKANGAROOKANGAROOKANGAROOKANGAROO
Answer:Maximum value of SEL is 3.The possible output is belowDEERMonkey MonkeyKangaroo Kangaroo KangarooThus (iv) is the correct option.
TOPIC-3Random Functions
Question 1.What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to variable PICKER. [CBSE Outside Delhi-2016]
import random PICKER = random randint (0, 3) COLOR = ["BLUE", "PINK", "GREEN", "RED"]: for I in COLOR : for J in range (1, PICKER): Print (I, end = " ") Print ()
(i)(ii)(iii) (iv)BLUEBLUEPINKSLUEBLUEPINKBLUEPINKPINKGREENPINKPINKGREENBLUEPINKGREENGREENREDGREENGREENREDBLUEPINKGREENREDREDRED
Answer:Option (i) and (iv) are possibleORoption (i) onlyPICKER maxval = 3 minval = 0
Question 2.What are the possible outcome(s) expected from the following python code? Also specifymaximum and minimum value, which we can have. [CBSE SQP 2015]
def main(): p = ‘MY PROGRAM’ i = 0 while p[i] != ‘R’: l = random.randint(0,3) + 5 print p[l],’-’, i += 1
(i) R – P – O – R –(ii) P – O – R – Y –(iii) O -R – A – G –(iv) A- G – R – M –Answer:Minimum value=5Maximum value=8So the only possible values are O, G, R, AOnly option (iii) is possible.
TOPIC-4Correcting The Errors
Question 1.Rewrite the following Python code after removing all syntax error(s). Underline the corrections done.[CBSE SQP 2015]
def main(): r = raw-input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ” + a
Answer:
def main (): r = raw_input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ”, a
Question 2.Rectify the error (if any) in the given statements.
>> str=“Hello Python” >>> str[6]=‘S’
Answer:
str[6] = ‘S’ is incorrect ‘str’ object does not support item assignment. str.replace(str[6],‘S’).
Question 3.Find the errors from the following code:T=[a,b,c]print TAnswer:NameError: name ‘a’ is not defined .T=[‘a’,‘b’,‘c’]
Question 4.Find the errors from the following code:for i in 1 to 100:print IAnswer:for i in range (1,100):print i
Question 5.Find the errors from the following code:
i=10 ; while [i<=n]: print i i+=10
Answer:
i=10 n=100 while (i<=n): print i i+=10
Question 6.Find the errors from the following code:
if (a>b) print a: else if (a<b) print b: else print “both are equal”
Answer:
if (a>b) // missing colon print a: else if (a<b) // missing colon // should be elif print b: else // missing colon print “both are equal"
Question 7.Find errors from the following codes:
c=dict() n=input(Enter total number) i=1 while i<=n: a=raw_input(“enter place”) b=raw_input(“enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[a[i]]
Answer:
c=dict() n=input(‘‘Enter total number”) i=1 while i<=n : a=raw_input(“enter place”) b=raw_inputf enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[i]
Question 8.Observe the following class definition and answer the question that follows : [CBSE SQP 2016]
class info: ips=0 def _str_(self): #Function 1 return "Welcome to the Info Systems" def _init_(Self): self. _ Sstemdate= " " self. SystemTime = " " def getinput (self): self . Systemdate = raw_input ("enter data") self , SystemTime = raw_Input ("enter data") Info, incrips () Estaiomethod # Statement 1 def incrips (): Info, ips, "times" I = Info () I. getinput () Print I. SystemTime Print I. _Systemdate # Statement 2
i. Write statement to invoke Function 1.ii. On Executing the above code, Statement 2 is giving an error explain.Answer:i. print Iii. The statement 2 is giving an error because _ Systemdate is a private variable and hence cannot to be printed outside the class.
TOPIC – 5Short Programs
Question 1.Write a program to calculate the area of a rectangle. The program should get the length and breadth ;values from the user and print the area.Answer:
length = input(“Enter length”) breadth = input(“Enter breadth”) print “Area of rectangle =”,length*breadth
Question 2.Write a program to calculate the roots of a quadratic equation.Answer:
import math a = input(“Enter co-efficient of x^2”) b = input(“Enter co-efficient of x”) c = inputfEnter constant term”) d = b*b - 4*a*c if d == 0: print “Roots are real and equal” root1 = root2 = -b / (2*a) elif d > 0: print “Roots are real and distinct” root1 = (- b + math.sqrt(d)) / (2*a) root2 = (-b - math.sqrt(d)) / (2*a) else: print “Roots are imaginary” print “Roots of the quadratic equation are”,root1,“and”,root2
Question 3.Write a program to input any number and to print all the factors of that number.Answer:
n = inputfEnter the number") for i in range(2,n): if n%i == 0: print i,“is a factor of’.n
Question 4.Write a program to input ,.any number and to check whether given number is Armstrong or not.(Armstrong 1,153,etc. 13 =1, 13+53 +33 =153)Answer:
n = inputfEnter the number”) savedn = n sum=0 while n > 0: a = n%10 sum = sum + a*a*a n = n/10 if savedn == sum: print savedn,“is an Armstrong Number” else: print savedn,”is not an Armstrong Number”
Question 5.Write a program to find all the prime numbers up to a given numberAnswer:
n = input("Enter the number”) i = 2 flag = 0 while (i < n): if (n%i)==0: flag = 1 print n,“is composite” break i = i+ 1 if flag ==0 : print n,“is prime”
Question 6.Write a program to convert decimal number to binary.Answer:
i=1 s=0 dec = int ( raw_input(“Enter the decimal to be converted:”)) while dec>0: rem=dec%2 s=s + (i*rem) dec=dec/2 i=i*10 print “The binary of the given number is:”,s raw_input()
Question 7.Write a program to convert binary to decimalAnswer:
binary = raw_input(“Enter the binary string”) decimal=0 for i in range(len(str(binary))): power=len (str (binary)) - (i+1) decimal+=int(str(binary)[i])*(2**power) print decimal
Question 8.Write a program to input two complex numbers and to find sum of the given complex numbers.Answer:
areal = input("Enter real part of first complex number”) aimg = input("Enter imaginary part of first complex number”) breal = input("Enter real part of second complex number”) bimg = input("Enter imaginary part of second complex number”) totreal = areal + breal totimg = aimg + bimg print “Sum of the complex numbers=",totreal, “+i”, totimg
Question 9.Write a program to input two complex numbers and to implement multiplication of the given complex numbers.Answer:
a = input("Enter real part of first complex number”) b = input("Enter imaginary part of first complex number”) c = input("Enter real part of second complex number”) d = input("Enter imaginary part of second complex number”) real= a*c - b*d img= a*d + b*c print “Product of the complex numbers=",real, “+i”,img
Question 10.Write a program to find the sum of all digits of the given number.Answer:
n = inputfEnter the number”) rev=0 while (n>0): a=n%10 sum = sum + a n=n/10 print “Sum of digits=”,sum
Question 11.Write a program to find the reverse of a number.Answer:
n = input("Enter the number”) rev=0 while (n>0): a=n%10 rev=(rev*10)+a n=n/10 print “Reversed number=”,rev
Question 12.Write a program to print the pyramid.12 23 3 34 4 4 45 5 5 5 5Answer:
for i in range(1,6): for j in range(1,i+1): print i, print
Question 13.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(username.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 14.Write a generator function generatesq () that displays the squareroots of numbers from 100 to nwhere n is passed as an argument.Answer:
import math def generatesq (n) : for i in range (100, n) : yield (math, sqrt (i))
Question 15.Write a method in Python to find and display the prime number between 2 to n.Pass n as argument to the method.Answer:
def prime (N) : for a in range (2, N): for I in range (2, a): if N%i ==0 : break print a OR def prime (N): for a in range (2, N): for I in range (2, a) : if a%1= = 0 : break else : print a
Question 16.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(usemame.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 17.Which string method is used to implement the following: [CBSE Text Book]
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character.
Answer:
len(str)
str.title() or str.capitalize()
str.isalpha and str.isdigit()
lower(str[i])
str.replace(char, newchar)
Question 18.Write a program to input any string and to find the number of words in the string.Answer:
str = “Honesty is the best policy” words = str.split() print len(words)
Question 19.Write a program to input n numbers and to insert any number in a particular position.Answer:
n=input(“Enter no. of values") num=[] for i in range (n): number=input(“Enter the number") num.append(number) newno = input(“Enter the number to be inserted”) pos = input(“Enter position”) num.insert(newno,pos) print num
Question 20.Write a program to input n numbers and to search any number from the list.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) search = input(“Enter number to be searched") for i in range(n): if num[i]==search: print search,“found at position”,i flag=1 if flag==0: print search, “not found in list”
Question 21.Write a program to search input any customer name and display customer phone numberif the customer name is exist in the list.Answer:
def printlist(s): i=0 for i in range(len(s)): print i,s[i] i = 0 phonenumbers = [‘9840012345’,‘9840011111’,’ 9845622222’,‘9850012345’,‘9884412345’] flag=0 number = raw_input(“Enter the phone number to be searched") number = number.strip() try: i = phonenumbers.index(number) if i >= 0: flag=1 except ValueError: pass if(flag <>0): print “\nphone number found in Phonebook at index”, i else: print'\iphonenumbernotfoundin phonebook” print “\nPHONEBOOK” printlist(phonenumbers)
Question 22.Write a program to input n numbers and to reverse the set of numbers without using functions.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) j=n-1 for i in range(n): if i<=n/2: num[i],num[j] = num[j],num[i] j=j-1 else: break print num
Question 23.Find and write the output of the following Python code: [CBSE Complementry-2016]
class Client: def init (self, ID = 1, NM=”Noname”) # constructor self.CID = ID self. Name = NM def Allocate (self, changelD, Title) : self.CID = self.CID + Changeld self.Name = Title + self. Name def Display (self) : print (self. CID). "#”, self. Name) C1 = Client () C2 = Client (102) C3 = Client (205, ‘’Fedrick”) C1 . Display () C2 . Display () C3 . Display () C2 . Allocate (4, "Ms.”) C3 .Allocate (2, "Mr.”) C1. Allocate (1, "Mrs.”) C1. Display () C2 . Display () C3 . Display ()
Answer:
CID Name — Fedrick 102 Mr. Fedrick 205 Mrs. Fedrick — Mr. & Mrs. Fedrick
Question 24.What will be the output of the following Python code considering the following set of inputs?
MAYA Your 5 Apples Mine2 412 Also, explain the try and except used in the code. Count = 0 while True : try: Number=int (raw input ("Input a Number :")) break Except valueError : Count=Count + 2 # For later versions of python, raw_input # Should be consider as input
mehtods:– DenCal () # Method to calcualte Density as People/Area– Add () # Method to allow user to enter values Dcode, DName, People, Area and Call DenCal () Mehtod– View () # Method to display all the data members also display a message “”High Population”if the Density is more than 8000.Answer:Output is below2 Re Enter Number10 Re Enter Number5 Input = Number3 Input = numberTry and except are used for handling exception in the Pythan code.
Question 25.Write a method in Python and display the prime numbers between 2 to N. Pass as argument to the methods.Answer:
def prime (N) : for a in range (2, N) Prime=1 for I in range (2, a): if a%i= = 0 : Prime = 0 if Prime = = 1: print a OR def prime (N) : for a in range (2, N): for I in range (2, a) : if a%i = = 0: break else : print a OR Any other correct code performing the same
Long Answer Type Questions (6 marks)
Question 1.Aastha wnats to create a program that accepts a string and display the characters in the reversein the same line using a Stack. She has created the following code, help her by completing thedefinitions on the basis of requirements given below:[CBSE SQP 2016]
Class mystack : def inin (self): selfe. mystr= # Accept a string self.mylist= # Convert mystr to a list # Write code to display while removing element from the stack. def display (self) : : :
Answer:
class mystack : def _init_ (self) : self.myster= rawjnput ("Enter the string”) self.mylist = list (self.mystr) def display (self) : x = len (self. mylist) if (x > 0) : for i in range (x) : print self.mylist.pop (), else : print "Stack is empty”
via Blogger https://ift.tt/3kkMk05
0 notes
Text
NCERT Class 12 Computer Science Chapter 1 Review of Python
NCERT Class 12 Computer Science Python Solutions for Chapter 1 :: Review of Python
TOPIC-1
Python Basics
Very Short Answer Type Questions(1 mark)
Question 1.Name the Python Library modules which need to be imported to invoke the following functions:
load ()
pow () [CBSE Delhi 2016]
Answer:
pickle
math
Question 2.Name the modules to which the following func-tions belong:
Uniform ()
fabs () [CBSE SQP 2016]
Answer:
random ()
math ()
Question 3.Differentiate between the round() and floor() functions with the help of suitable example.[CBSE Comptt. 2016]Answer:The function round() is used to convert a fractional number into whole as the nearest next whereas the function floor() is used convert to the nearest lower whole number, e.g.,round (5.8) = 6, round (4.1) = 5 and floor (6.9) = 6, floor (5.01) = 5
Short Answer Type Questions (2 marks):
Question 1.Out of the following, find those identifiers, which cannot be used for naming Variables or functions in a Python program:Total * Tax, While, Class, Switch, 3rd Row, finally, Column 31, Total. [CBSE Outside Delhi-2016]Answer:Total * Tax, class, 3rd Row, finally
Question 2.Name the Python Library modules which need to be imported to invoke the follwing functions :
sqrt()
dump() (CBSE Outside Delhi-2016)
Answer:
math
pickle
Question 3.Out of the following, find the identifiers, which cannot be used for naming Variable or Functions in a Python program: [CBSE Delhi 2016]_Cost, Price*Qty, float, switch, Address one, Delete, Number12, doAnswer:Price *Qty, float, Address one, do
Question 4.Out of the following find those identifiers, which can not be used for naming Variable or Functions in a Python Program:Days * Rent, For, A_price, Grand Total, do, 2Clients, Participantl, My cityAnswer:Illegal variables or functions name are as below: Days * Rent, do, 2Clients, For and Grant Total Because of being either keyword or including space or operator or starting with integar.
Question 5.Name the function / method required for [CBSE SQP 2015]
Finding second occurrence of m in madam.
get the position of an item in the list.
Answer:
find
index
Question 6.Which string method is used to implement the following:
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character. [CBSE TextBook]
Answer:
len(str)
str.capitalize()
ch.isalnum()
str.upper()
str.replace(old,new)
Question 7.What is the difference between input() and raw_input()?Answer:raw_input() takes the input as a string whereas input() basically looks at what the user enters, and automatically determines the correct type. We use the inputQ function when you are expecting an integer from the end-user, and raw_input when you are expecting a string.
Question 8.What are the two ways of output using print()?Answer:Ordinarily, each print statement produces one line of output. You can end the print statement with a trailing ’ to combine the results of multiple print statements into a single line.
Question 9.Why does the expression 2 + 3*4 result in the value 14 and not the value 24?Answer:Operator precedence rules* make the expression to be interpreted as 2 + (3*4) hence the result is 14.
Question 10.How many times will Python execute the code inside the following while loop? You should answer the question without using the interpreter! Justify your answers.
i = 0 while i < 0 and i > 2 : print “Hello ...” i = i+1
Answer:0 times.
Question 11.How many times will Python execute the code inside the following while loop?
i = 1 while i < 10000 and i > 0 and 1: print “ Hello ...” i = 2 * i
Answer:14.
Question 12.Convert the following for loop into while loop, for i in range (1,100):
if i % 4 == 2 : print i, “mod”, 4 , “= 2”
Answer:
i=1 while i < 100: if i % 4 == 2: print i, “mod”, 4 , “= 2” i = i +1
Question 13.Convert the following for loop into while loop.
for i in range(10): for j in range(i): print '$', print"
Answer:
i=0 while i < 10: j=0 while j < i: print '$’ print"
Question 14.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(25,500,25): print a
Answer:
a=25 while a < 500: print a a = a + 25
Question 15.Rewrite the following for loop into while loop: [CBSE Text Book]
for a in range(90, 9, -9): print a
Answer:
a = 90 while a > 9: print a a = a-9
Question 16.Convert the following while loop into for loop:
i = 0 while i < 100: if i % 2 == 0: print i, “is even” else: print i, “is odd” i = i + 1
Answer:
for i in range(100): if i % 2 == 0: print i, “is even” else : print i, “is odd”
Question 17.Convert the following while loop into for loop
char = "" print “Press Tab Enter to stop ...” iteration = 0 while not char == “\t” and not iteration > 99: print “Continue?” char = raw_input() iteration+ = 1
Answer:
char = "" print “Press Tab Enter to stop ...” for iteration in range(99): if not char == ‘\t’: print “Continue?” char = raw_input()
Question 18.Rewrite the following while loop into for loop:
i = 10 while i<250: print i i = i+50
Answer:
for i in range(10, 250, 50): print i
Question 19.Rewrite the following while loop into for loop:
i=88 while(i>=8): print i i- = 8
Answer:
for i in range(88, 9, -8) print i
Question 20.Write for statement to print the series 10,20,30, ……., 300Answer:
for i in range(10, 301, 10): print i
Question 21.Write for statement to print the series 105,98,91,… .7Answer:
for i in range(105, 8, -7): print i
Question 22.Write the while loop to print the series: 5,10,15,…100Answer:
i=5 while i <= 100: print i i = i + 5
Question 23.How many times is the following loop executed? [CBSE Text Book]for a in range(100,10,-10):print aAnswer:9 times.
Question 24.How many times is the following loop executed? [CBSE Text Book]
i = 100 while (i<=200): print i i + =20
Answer:6 times
Question 25.State whether the statement is True or False? No matter the underlying data type if values are equal returns true,
char ch1, ch2; if (ch1==ch2) print “Equal”
Answer:True. Two values of same data types can be equal.
Question 26.What are the logical operators of Python?Answer:or, and, not
Question 27.What is the difference between ‘/’ and ‘//’ ?Answer:
// is Integer or Floor division whereas / is normal division (eg) 7.0 // 2 → 3.0 7.0/2 → 3.5
Question 28.How can we import a module in Python?Answer:1. using import
Syntax: import[,,...] Example: import math, cmath
2. using from
Syntax: fromimport[, ,.. ,] Example: . from fib. import fib, fib2.
Question 29.What is the difference between parameters and arguments?Answer:
S.No.ParametersArguments1Values provided in function headerValues provided in function call.2(eg) def area (r):—> r is the parameter(eg) def main() radius = 5.0 area (radius)—> radius is the argument
Question 30.What are default arguments?Answer:Python allowes function arguments to have default values; if the function is called without the argument, the argument gets its default value
Question 31.What are keyword arguments?Answer:If there is a function with many parameters and we want to specify only some of them in function call,then value for such parameters can be provided by using their names instead of the positions. These are called keyword argument.
(eg) def simpleinterest(p, n=2, r=0.6) ' def simpleinterest(p, r=0.2, n=3)
Question 32.What are the advantages of keyword arguments?Answer:It is easier to use since we need not remember the order of the arguments.We can specify the values for only those parameters which we want, and others have default values.
Question 33.What does “in” do?Answer:“in” is a membership operator. It evaluates to true if it finds a variable/string in the specified sequence :Otherwise i+evaluates to false.
(eg) S = “Hello World" if “Hell” in S: print “True” will print True.
Question 34.What does “not in” do?Answer:“not in” is a membership operator. It evaluates to true if it does not finds a variable/stringin the specified sequence. Otherwise it evaluates to false,
(eg) S = “Hello World” if “Hell” not in S: print “False” will print False.
Question 35.What does “slice” do?Answer:The slice[n:m] operator extracts subparts from a string. It doesn’t include the character at index m.
(eg) S = “Hello World” print s[0:4] → Hell
Question 36.What is the use of negative indices in slicing?Answer:Python counts from the end (right) if negative indices are given.
(eg) S = “Hello” print S[:-3] >> He print S[-3:] >> llo
Question 37.Explain find() function?Answer:find (sub[,start[,end]])This function is used to search the first occurrence of the substring in the given string.It returns the index at which the substring starts. It returns -1 if the substring doesn’t occur in the string.
(eg) str = “computer” - str.findf("om”) → 1
Question 38.What are the differences between arrays and lists?Answer:An array holds fixed number of values. List is of variable-length – elements can be dynamically added or removedAn array holds values of a single type. List in Python can hold values of mixed data type.
Question 39.What is the difference between a tuple and a list?Answer:A tuple is immutable whereas a list is a mutable.A tuple cannot be changed whereas a list can be changed internally.A tuple uses parenthess (()) whereas a list uses square brackets ([]).tuple initialization: a = (2, 4, 5)list initialization: a = [2, 4, 5]
Question 40.Carefully observe the following python code and answer the question that follows:x=5def func2():x=3global xx=x+1print xprint xOn execution the above code produces the following output.63Explain the output with respect to the scope of the variables.Answer:Names declared with global keyword have to be referred at the file level. This is because the global scope.If no global statement is being used the variable with the local scope is accessed.Hence, in the above code the statement succeeding the statement global x informs Python to incrementthe global variable xHence, the output is 6 i.e. 5 + 1 which is also the value for global x.When x is reassingned with the value 3 the local x hides the global x and hence 3 printed.(2 marks for explaning the output) (Only 1 mark for explaining global and local namespace.)
Question 41.Explain the two strategies employed by Python for memory allocation. [CBSE SQP 2016]Answer:Pythonuses two strategies for memory allocation-(i) Reference counting(ii) Automatic garbage collectionReference Counting: works by counting the number of times an object is referenced by other in the system.When an object’s reference count reaches zero, Python collects it automatically.Automatic Garbage Collection: Python schedules garbage collection based upon a threshold of object allocations and object deallocations. When the number of allocations minus the number of deallocations are greater that the threshold number, the garbage collector is run and the unused blocks of memory is reclaimed.
TOPIC – 2Writing Python Programs
Question 1.Rewrite the following code in Python after removing all syntax errors(s). Underline each correction done in the code. [CBSE Delhi-2016]for Name in [Amar, Shveta, Parag]if Name [0] = ‘s’:Print (Name)Answer:
for Name in [“_Amar”, ”_Shveta_” , "_Parag_”] : if Name [0] E == ‘S’ : Print (Name)
Question 2.Rewrite the following code is Python after removing all syntax errors(s).Underline each correction done in the code. [CBSE Outside Delhi-2016]for Name in [Ramesh, Suraj, Priya]if Name [0] = ‘S’:Print (Name)Answer:
for Name in [“_Ramesh_”, “_Suraj_” , “_Priya_”] if Name [0] =_=‘S’ : print (Name)
Question 3.What will be the output of the following python code considering the following set of inputs?AMARTHREEA1231200Also, explain the try and except used in the code.Start = 0while True :Try:Number = int (raw input (“Enter Number”))breakexcept valueError : start=start+2print (“Re-enter an integer”)Print (start)Answer:Output:
Enter Number AMAR Re-enter an integer Enter Number THREE Re-enter an integer Enter Number A123 Re-enter an integer Enter Number 12006
Explanation : The code inside try makes sure that the valid number is entered by the user.When any input other an integer is entered, a value error is thrown and it prompts the user to enter another value.
Question 4.Give the output of following with justification. [CBSE SQP 2015]
x = 3 x+ = x-x print x
Answer:Output: 3Working:
x = 3 x = (x+ x-x ):x = 3 + 3 - 3 = 3
Question 5.What will be printed, when following Python code is executed? [CBSE SQP 2015]
class person: def init (self,id): self.id = id arjun = person(150) arjun. diet [‘age’] = 50 print arjun.age + len(arjun. diet )
Justify your answer.Answer:52arjun.age = 50arjun.dict has 2 attributes so length of it is 2. So total = 52.
Question 6.What would be the output of the following code snippets?print 4+9print “4+9”Answer:13 (addition), 49 (concatenation).
Question 7.Highlight the literals in the following programand also predict the output. Mention the types ofvariables in the program.
a=3 b='1' c=a-2 d=a-c e=“Kathy” f=‘went to party.’ g=‘with Sathy’ print a,g,e,f,a,g,“,”,d,g,“,”,c,g,“and his”,e,f
Answer:a, c,d = integerb, e,f,g = stringOutput: 3 with Sathy Kathy, went to party. 3 with Sathy, 2 with Sathy , 1 with Sathy and his Kathy, went to party.
Question 8.What is the result of 4+4/2+2?Answer:4 + (4/2) + 2 = 8.
Question 9.Write the output from the following code: [CBSE Text Book]
x= 10 y = 20 if (x>y): print x+y else: print x-y
Answer:– 10
Question 10.Write the output of the following code:print “Python is an \n interpreted \t Language”Answer:Python is an interpreted Language
Question 11.Write the output from the following code:
s = 0 for I in range(10,2,-2): s+=I print “sum= ",s
Answer:sum= 28
Question 12.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 13.Write the output from the following code: [CBSE TextBook]
n = 50 i = 5 s = 0 while i<n: s+ = i i+ = 10 print “i=”,i print “sum=”,s
Answer:
i= 15 i= 25 i= 35 i= 45 i= 55 sum= 125
Question 14.Observe the following program and answer the question that follows:import randomx = 3N = random, randint (1, x)for 1 in range (N):print 1, ‘#’, 1 + 1a. What is the minimum and maximum number of times the loop will execute?b. Find out, which line of output(s) out of (i) to (iv) will not be expected from the program?i. 0#1ii. 1#2iii. 2#3iv. 3#4Answer:a. Minimum Number = 1Maximum number = 3b. Line iv is not expected to be a part of the output.
Question 15.Observe the following Python code carefully and obtain the output, which will appear on the screen after execution of it. [CBSE SQP 2016]
def Findoutput (): L = "earn" X = " " count = 1 for i in L: if i in ['a', 'e',' i', 'o', 'u']: x = x + 1. Swapcase () else: if (count % 2 ! = 0): x = x + str (len (L[:count])) else: x = x + 1 count = count + 1 print x Findoutput ()
Answer:EA3n
Question 16.Find and write the output of the following Python code:
Number = [9,18,27,36] for N in Numbers: print (N, "#", end = " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1#001#(1#)(1#)2#(1#)(1#2#)1#(2#)(1#2#3#)2#(1#)1#3#(2#)1#2#(3#)1#2#3#
Question 17.What are the possible outcome(s) executed from the following code? Also,specify the maximum and import random. [CBSE Delhi 2016]
PICK=random.randint (0,3) CITY= ["DELHI", "MUMBAI", "CHENNAI", "KOLKATA"]; for I in CITY : for J in range (1, PICK) print (I, end = " ") Print ()
(i)(ii)DELHIDELHIDELHIMUMBAIMUMBAIDELHIMUMBAICHENNAICHENNAIDELHIMUMBAICEHNNAIKOLKATAKOLKATA(iii)(iv)DELHIDELHIMUMBAIMUMBAIMUMBAICHENNAIKOLKATAKOLKATAKOLKATAKOLKATA
Answer:Option (i) and (iii) are possible option (i) onlyPICKER maxval = 3 minval = 0
Question 18.Find and write the output of the following Python code : [CBSE Outside Delhi-2016]
Values = [10,20,30,40] for val in Values: for I in range (1, Val%9): print (I," * ", end= " ") print ()
Answer:
ElementStack of operatorsPostfix Expression1*001*(1.*)(1*)2*0(1*2*)1*(1,*)(1*2*3*)2*(2.*)1*3*01*2*(1.*)1*2*3*(2,* )(3,* )
Question 19.Write the output from the following code:
y = 2000 if (y%4==0): print “Leap Year” else: print “Not leap year”
Answer:Leap Year.
Question 20.What does the following print?
for i in range (1,10): for j in'range (1,10): print i * j, print
Answer:1 2 3 4 5 6 7 8 92 4 6 8 10 12 14 16 183 6 9 12 15 18 21 24 274 8 12 16 20 24 28 32 365 10 15 20 25 30 35 40 456 12 18 24 30 36 42 48 547 14 21 28 35 42 49 56 638 16 24 32 40 48 56 64 729 18 27 36 45 54 63 72 81
Question 21.What will be the output of the following statement? Also, justify the answer.
>> print ‘Radhsa’s dress is pretty’.
Answer:SyntaxError: invalid syntax.The single quote needs to be replaced by V to get the expected output.
Question 22.Give the output of the following statements :
>>> str=‘Honesty is the best policy’ >>> str.replace(‘o’,‘*’)
Answer:‘H*nesty is the best p*licy’.
Question 23.Give the output of the following statements :
>> str=‘Hello Python’ >>> str.istitle()
Answer:True.
Question 24.Give the output of the following statements:
>> str=‘Hello Python’ >>> print str.lstrip(“Hel”)
Answer:Hello Python
Question 25.Write the output for the following codes:
A={10:1000,20:2000,30:3000,40:4000,50:5000} print A.items() print A.keys() print A.values()
Answer:[(40,4000), (10,1000), (20,2000), (50,5000), (30,3000)] [40,10, 20, 50, 30] [4000,1000, 2000, 5000, 3000]
Question 26.Write the output from the following code:
t=(10,20,30,40,50) print len(t)
Answer:5
Question 27.Write the output from the following code:
t=(‘a’,‘b’,‘c’,‘A’,‘B’) print max(t) print min(t)
Answer:‘c’A’
Question 28.Find the output from the following code:
T=(10,30,2,50,5,6,100,65) print max(T) print min(T)
Answer:1002
Question 29.Write the output from the following code:
T1=(10,20,30,40,50) T2 =(10,20,30,40,50) T3 =(100,200,300) cmp(T1, T2) cmp(T2,T3) cmp(T3,T1)
Answer:0-11
Question 30.Write the output from the following code:
T1=(10,20,30,40,50) T2=(100,200,300) T3=T1+T2 print T3
Answer:(10,20,30,40,50,100,200,300)
Question 31.Find the output from the following code:
t=tuple() t = t +(‘Python’,) print t print len(t) t1=(10,20,30) print len(t1)
Answer:(‘Python’,)13
Question 32.Rewrite the following code in Python after remo¬ving all syntax error(s).Underline each correction done in the code.
for student in [Jaya, Priya, Gagan] If Student [0] = ‘S’: print (student)
Answer:for studednt in values [“Jaya”, “Priya”, “Gagan”]:if student [0] = = “S”print (student)
Question 33.Find and write the output of the following Python code:
Values = [11, 22, 33, 44] for V in Values: for NV in range (1, V%10): print (NV, V)
Answer:1, 112,223,334, 44
Question 34.What are the possible outcome(s) executed from the following code? Also, specify the maximum and minimum values that can be assigned to variable SEL.
import random SEL=random. randint (0, 3) ANIMAL = [“DEER”, “Monkey”, “COW”, “Kangaroo”]; for A in ANIMAL: for AAin range (1, SEL): print (A, end =“”) print ()
(i)(ii)(iii)(iv)DEERDEERDEERDEERDEERMONKEYMONKEYDELHIMONKEYMONKEYMONKEYMONKEYCOWCOWDELHIMONKEYCOWCOWKANGAROOKANGAROOKANGAROOKANGAROOKANGAROOKANGAROO
Answer:Maximum value of SEL is 3.The possible output is belowDEERMonkey MonkeyKangaroo Kangaroo KangarooThus (iv) is the correct option.
TOPIC-3Random Functions
Question 1.What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to variable PICKER. [CBSE Outside Delhi-2016]
import random PICKER = random randint (0, 3) COLOR = ["BLUE", "PINK", "GREEN", "RED"]: for I in COLOR : for J in range (1, PICKER): Print (I, end = " ") Print ()
(i)(ii)(iii) (iv)BLUEBLUEPINKSLUEBLUEPINKBLUEPINKPINKGREENPINKPINKGREENBLUEPINKGREENGREENREDGREENGREENREDBLUEPINKGREENREDREDRED
Answer:Option (i) and (iv) are possibleORoption (i) onlyPICKER maxval = 3 minval = 0
Question 2.What are the possible outcome(s) expected from the following python code? Also specifymaximum and minimum value, which we can have. [CBSE SQP 2015]
def main(): p = ‘MY PROGRAM’ i = 0 while p[i] != ‘R’: l = random.randint(0,3) + 5 print p[l],’-’, i += 1
(i) R – P – O – R –(ii) P – O – R – Y –(iii) O -R – A – G –(iv) A- G – R – M –Answer:Minimum value=5Maximum value=8So the only possible values are O, G, R, AOnly option (iii) is possible.
TOPIC-4Correcting The Errors
Question 1.Rewrite the following Python code after removing all syntax error(s). Underline the corrections done.[CBSE SQP 2015]
def main(): r = raw-input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ” + a
Answer:
def main (): r = raw_input(‘enter any radius : ’) a = pi * math.pow(r,2) print “ Area = ”, a
Question 2.Rectify the error (if any) in the given statements.
>> str=“Hello Python” >>> str[6]=‘S’
Answer:
str[6] = ‘S’ is incorrect ‘str’ object does not support item assignment. str.replace(str[6],‘S’).
Question 3.Find the errors from the following code:T=[a,b,c]print TAnswer:NameError: name ‘a’ is not defined .T=[‘a’,‘b’,‘c’]
Question 4.Find the errors from the following code:for i in 1 to 100:print IAnswer:for i in range (1,100):print i
Question 5.Find the errors from the following code:
i=10 ; while [i<=n]: print i i+=10
Answer:
i=10 n=100 while (i<=n): print i i+=10
Question 6.Find the errors from the following code:
if (a>b) print a: else if (a<b) print b: else print “both are equal”
Answer:
if (a>b) // missing colon print a: else if (a<b) // missing colon // should be elif print b: else // missing colon print “both are equal"
Question 7.Find errors from the following codes:
c=dict() n=input(Enter total number) i=1 while i<=n: a=raw_input(“enter place”) b=raw_input(“enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[a[i]]
Answer:
c=dict() n=input(‘‘Enter total number”) i=1 while i<=n : a=raw_input(“enter place”) b=raw_inputf enter number”) c[a]=b i=i+1 print “place”,“\t”,“number” for i in c: print i,“\t”,c[i]
Question 8.Observe the following class definition and answer the question that follows : [CBSE SQP 2016]
class info: ips=0 def _str_(self): #Function 1 return "Welcome to the Info Systems" def _init_(Self): self. _ Sstemdate= " " self. SystemTime = " " def getinput (self): self . Systemdate = raw_input ("enter data") self , SystemTime = raw_Input ("enter data") Info, incrips () Estaiomethod # Statement 1 def incrips (): Info, ips, "times" I = Info () I. getinput () Print I. SystemTime Print I. _Systemdate # Statement 2
i. Write statement to invoke Function 1.ii. On Executing the above code, Statement 2 is giving an error explain.Answer:i. print Iii. The statement 2 is giving an error because _ Systemdate is a private variable and hence cannot to be printed outside the class.
TOPIC – 5Short Programs
Question 1.Write a program to calculate the area of a rectangle. The program should get the length and breadth ;values from the user and print the area.Answer:
length = input(“Enter length”) breadth = input(“Enter breadth”) print “Area of rectangle =”,length*breadth
Question 2.Write a program to calculate the roots of a quadratic equation.Answer:
import math a = input(“Enter co-efficient of x^2”) b = input(“Enter co-efficient of x”) c = inputfEnter constant term”) d = b*b - 4*a*c if d == 0: print “Roots are real and equal” root1 = root2 = -b / (2*a) elif d > 0: print “Roots are real and distinct” root1 = (- b + math.sqrt(d)) / (2*a) root2 = (-b - math.sqrt(d)) / (2*a) else: print “Roots are imaginary” print “Roots of the quadratic equation are”,root1,“and”,root2
Question 3.Write a program to input any number and to print all the factors of that number.Answer:
n = inputfEnter the number") for i in range(2,n): if n%i == 0: print i,“is a factor of’.n
Question 4.Write a program to input ,.any number and to check whether given number is Armstrong or not.(Armstrong 1,153,etc. 13 =1, 13+53 +33 =153)Answer:
n = inputfEnter the number”) savedn = n sum=0 while n > 0: a = n%10 sum = sum + a*a*a n = n/10 if savedn == sum: print savedn,“is an Armstrong Number” else: print savedn,”is not an Armstrong Number”
Question 5.Write a program to find all the prime numbers up to a given numberAnswer:
n = input("Enter the number”) i = 2 flag = 0 while (i < n): if (n%i)==0: flag = 1 print n,“is composite” break i = i+ 1 if flag ==0 : print n,“is prime”
Question 6.Write a program to convert decimal number to binary.Answer:
i=1 s=0 dec = int ( raw_input(“Enter the decimal to be converted:”)) while dec>0: rem=dec%2 s=s + (i*rem) dec=dec/2 i=i*10 print “The binary of the given number is:”,s raw_input()
Question 7.Write a program to convert binary to decimalAnswer:
binary = raw_input(“Enter the binary string”) decimal=0 for i in range(len(str(binary))): power=len (str (binary)) - (i+1) decimal+=int(str(binary)[i])*(2**power) print decimal
Question 8.Write a program to input two complex numbers and to find sum of the given complex numbers.Answer:
areal = input("Enter real part of first complex number”) aimg = input("Enter imaginary part of first complex number”) breal = input("Enter real part of second complex number”) bimg = input("Enter imaginary part of second complex number”) totreal = areal + breal totimg = aimg + bimg print “Sum of the complex numbers=",totreal, “+i”, totimg
Question 9.Write a program to input two complex numbers and to implement multiplication of the given complex numbers.Answer:
a = input("Enter real part of first complex number”) b = input("Enter imaginary part of first complex number”) c = input("Enter real part of second complex number”) d = input("Enter imaginary part of second complex number”) real= a*c - b*d img= a*d + b*c print “Product of the complex numbers=",real, “+i”,img
Question 10.Write a program to find the sum of all digits of the given number.Answer:
n = inputfEnter the number”) rev=0 while (n>0): a=n%10 sum = sum + a n=n/10 print “Sum of digits=”,sum
Question 11.Write a program to find the reverse of a number.Answer:
n = input("Enter the number”) rev=0 while (n>0): a=n%10 rev=(rev*10)+a n=n/10 print “Reversed number=”,rev
Question 12.Write a program to print the pyramid.12 23 3 34 4 4 45 5 5 5 5Answer:
for i in range(1,6): for j in range(1,i+1): print i, print
Question 13.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(username.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 14.Write a generator function generatesq () that displays the squareroots of numbers from 100 to nwhere n is passed as an argument.Answer:
import math def generatesq (n) : for i in range (100, n) : yield (math, sqrt (i))
Question 15.Write a method in Python to find and display the prime number between 2 to n.Pass n as argument to the method.Answer:
def prime (N) : for a in range (2, N): for I in range (2, a): if N%i ==0 : break print a OR def prime (N): for a in range (2, N): for I in range (2, a) : if a%1= = 0 : break else : print a
Question 16.Write a program to input username and password and to check whether the given username and password are correct or not.Answer:
import string usemame= raw_input(“Enter username”) password = raw_input(“Enter password”) if cmp(usemame.strip(),“XXX”)== 0: if cmp(password,”123”) == 0: print “Login successful” else: print “Password Incorrect” else: print “Username Incorrect”
Question 17.Which string method is used to implement the following: [CBSE Text Book]
To count the number of characters in the string.
To change the first character of the string in capital letter.
To check whether given character is letter or a number.
To change lowercase to uppercase letter.
Change one character into another character.
Answer:
len(str)
str.title() or str.capitalize()
str.isalpha and str.isdigit()
lower(str[i])
str.replace(char, newchar)
Question 18.Write a program to input any string and to find the number of words in the string.Answer:
str = “Honesty is the best policy” words = str.split() print len(words)
Question 19.Write a program to input n numbers and to insert any number in a particular position.Answer:
n=input(“Enter no. of values") num=[] for i in range (n): number=input(“Enter the number") num.append(number) newno = input(“Enter the number to be inserted”) pos = input(“Enter position”) num.insert(newno,pos) print num
Question 20.Write a program to input n numbers and to search any number from the list.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) search = input(“Enter number to be searched") for i in range(n): if num[i]==search: print search,“found at position”,i flag=1 if flag==0: print search, “not found in list”
Question 21.Write a program to search input any customer name and display customer phone numberif the customer name is exist in the list.Answer:
def printlist(s): i=0 for i in range(len(s)): print i,s[i] i = 0 phonenumbers = [‘9840012345’,‘9840011111’,’ 9845622222’,‘9850012345’,‘9884412345’] flag=0 number = raw_input(“Enter the phone number to be searched") number = number.strip() try: i = phonenumbers.index(number) if i >= 0: flag=1 except ValueError: pass if(flag <>0): print “\nphone number found in Phonebook at index”, i else: print'\iphonenumbernotfoundin phonebook” print “\nPHONEBOOK” printlist(phonenumbers)
Question 22.Write a program to input n numbers and to reverse the set of numbers without using functions.Answer:
n=input(“Enter no. of values”) num=[] flag=0 for i in range (n): number=input(“Enter the number”) num. append(number) j=n-1 for i in range(n): if i<=n/2: num[i],num[j] = num[j],num[i] j=j-1 else: break print num
Question 23.Find and write the output of the following Python code: [CBSE Complementry-2016]
class Client: def init (self, ID = 1, NM=”Noname”) # constructor self.CID = ID self. Name = NM def Allocate (self, changelD, Title) : self.CID = self.CID + Changeld self.Name = Title + self. Name def Display (self) : print (self. CID). "#”, self. Name) C1 = Client () C2 = Client (102) C3 = Client (205, ‘’Fedrick”) C1 . Display () C2 . Display () C3 . Display () C2 . Allocate (4, "Ms.”) C3 .Allocate (2, "Mr.”) C1. Allocate (1, "Mrs.”) C1. Display () C2 . Display () C3 . Display ()
Answer:
CID Name — Fedrick 102 Mr. Fedrick 205 Mrs. Fedrick — Mr. & Mrs. Fedrick
Question 24.What will be the output of the following Python code considering the following set of inputs?
MAYA Your 5 Apples Mine2 412 Also, explain the try and except used in the code. Count = 0 while True : try: Number=int (raw input ("Input a Number :")) break Except valueError : Count=Count + 2 # For later versions of python, raw_input # Should be consider as input
mehtods:– DenCal () # Method to calcualte Density as People/Area– Add () # Method to allow user to enter values Dcode, DName, People, Area and Call DenCal () Mehtod– View () # Method to display all the data members also display a message “”High Population”if the Density is more than 8000.Answer:Output is below2 Re Enter Number10 Re Enter Number5 Input = Number3 Input = numberTry and except are used for handling exception in the Pythan code.
Question 25.Write a method in Python and display the prime numbers between 2 to N. Pass as argument to the methods.Answer:
def prime (N) : for a in range (2, N) Prime=1 for I in range (2, a): if a%i= = 0 : Prime = 0 if Prime = = 1: print a OR def prime (N) : for a in range (2, N): for I in range (2, a) : if a%i = = 0: break else : print a OR Any other correct code performing the same
Long Answer Type Questions (6 marks)
Question 1.Aastha wnats to create a program that accepts a string and display the characters in the reversein the same line using a Stack. She has created the following code, help her by completing thedefinitions on the basis of requirements given below:[CBSE SQP 2016]
Class mystack : def inin (self): selfe. mystr= # Accept a string self.mylist= # Convert mystr to a list # Write code to display while removing element from the stack. def display (self) : : :
Answer:
class mystack : def _init_ (self) : self.myster= rawjnput ("Enter the string”) self.mylist = list (self.mystr) def display (self) : x = len (self. mylist) if (x > 0) : for i in range (x) : print self.mylist.pop (), else : print "Stack is empty”
from Blogger http://www.margdarsan.com/2020/09/ncert-class-12-computer-science-chapter_22.html
0 notes