Infinite Loop

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/WIPRO-PREPARATION/coeding/python-for-placements/python/asset-infinite-loop after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Aptitude: Number System, Percentage, Profit and Loss, Ratio and Proportion (Ratios), Average, Time and Work, Speed Time and Distance, Simple Interest and Compound Interest, Mixture and Alligation, Data Interpretation, Permutation and Combination, Probability, Logarithm, Powers and Exponents (Surds and Indices), Age Problems, Divisibility Rules, Partnership, HCF LCM, Algebra, Pipe and Cistern
  2. Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Analogy, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Logical Sequence Of Words, Data Sufficiency, Seating Arrangements, Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Data Arrangement
  3. English Language: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Vocabulary, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Active Passive Voice (Voice), Direct and Indirect Speech, Cloze Test (Cloze Passage), Tenses, Subject Verb Agreement (Verb Noun Agreement), Preposition, Articles, Conjunction, Adverb
  4. Written English Test: English Writing Ability
  5. Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  6. Communication Round: Communication Assessment
  7. DBMS (Technical Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, Relational Calculus, Transaction Management, Concurrency Control, Database Recovery, ORDBMS, Database Security & Authorization, Query Processing & Optimization, Enhanced Data Models, Big Data Systems, NoSQL, Data Warehousing & Mining
  8. SQL (Technical Interview): SQL
  9. Operating Systems (Technical Interview): Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS, Linux OS, Security, Distributed Systems, Virtual Machines
  10. Computer Networks (Technical Interview): Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Cloud Computing and IoT, Cyber and Info Security
  11. OOPs (Technical Interview): Object Oriented Programming (OOPS)
  12. HR Interview: MR & HR Interview Preparation
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This video is a coding tutorial that explains the concept of infinite loops in Python. The instructor, Yash Jain, begins by demonstrating a simple infinite loop using a while True: statement, which runs indefinitely and prints a counter value. He then shows a more practical example of an infinite loop used to create a command-line interface, where the loop continuously prompts the user for input and executes commands until the user types 'quit', at which point a break statement terminates the loop. The video uses a code editor to display the Python scripts and a terminal to show the program's output, illustrating both the problem of an uncontrolled loop and a controlled, user-driven loop.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The video opens with a view of a Python code editor displaying a file named 15.1InfiniteLoops.py. The code defines a variable 'count' and enters a while loop with the condition 'while True:'. Inside the loop, it prints the current value of 'count' and then increments it by one. The loop is designed to run forever, as the condition is always true. The instructor explains that this is an infinite loop. The code is then executed, and the terminal output shows a continuous stream of numbers, confirming the loop runs indefinitely. The instructor points out that this can be problematic if the program consumes memory, as it may eventually crash. The on-screen text includes comments like '# Infinite Loop' and '# Programs having infinite loops run forever'. The instructor's name, Yash Jain, and his credentials are displayed in a circular frame in the bottom right corner.

  2. 2:00 – 3:18 02:00-03:18

    The instructor switches to a new file, 15.2InfiniteLoops.py, to demonstrate a more practical use of an infinite loop. The code shows a 'while True:' loop that prompts the user for a command using 'command = input('>>>')'. It then prints the command and checks if the command is 'quit'. If it is, the 'break' statement is executed, which terminates the loop. The instructor explains that this pattern is common in command-line interfaces. The terminal output shows the loop running, accepting inputs like 'yash' and 'python', and continuing until the user types 'quit', at which point the program exits. The on-screen text includes comments like '# Command Line Interface' and '# If you are executing any operation in your program that consume memory, then, at some point your program may run out of memory and crash'. The instructor emphasizes that the 'break' statement is the key to controlling an infinite loop.

The video effectively teaches the concept of infinite loops by first presenting a simple, uncontrolled example and then a more sophisticated, controlled one. It demonstrates that a while True: loop will run indefinitely, which can be a problem if not managed. The key takeaway is that the 'break' statement provides a mechanism to exit an infinite loop, allowing for the creation of interactive programs like command-line interfaces. The progression from a problematic loop to a useful one highlights the importance of control flow in programming.

Loading lesson…