Python Tuple & List

RevivingIndia Meena bazar, Patna, India

What is Tuple? A tuple is a collection that is ordered and unchangeable. Tuples are written with round brackets. It is a collection of objects which ordered and immutable. Allow duplicate values. How to create Tuple? #Empty Tuple empty_tuple = () print (empty_tuple) #Single Element To write a tuple containing a single value you have to include a comma, even though there is only one value x= (50,) #mutiple element x= ("apple", “54.23", “23", "apple", “India") print (this tuple) READ OR ACCESS To access values in the tuple, use the square brackets. For multiple elements use slicing. X = (10,20,30) X X  #Range of Indexes You can use positive and negative index both. How to update Tuple? Tuples are unchangeable, that you cannot change, add, or remove items once the tuple is created. tup1 = (12, 34.56) # Following action is not valid for tuples  tup1 = 100  #throw Error How to…

Read more

Presentation

RevivingIndia Meena bazar, Patna, India

Presentation: Engage, inform, captivate, convey, With slides and speech, pave the way. Audience hooked, from start to end, A presentation, a message to send. Our presentation today, we embark on a journey into the fascinating world of Python and robotics—an intersection where technology and creativity converge to shape the future. Imagine a world where machines come to life, guided by lines of code written in Python—a language known for its simplicity, versatility, and power. With Python as our tool, we unlock endless possibilities in the realm of robotics, from autonomous vehicles to intelligent machines that enhance our daily lives. As we delve deeper, let us explore how Python serves as the backbone of robotic development. Its intuitive syntax and extensive libraries empower both novice and seasoned engineers to design, prototype, and deploy robotic systems with unprecedented efficiency and precision

IR Sensor

RevivingIndia Meena bazar, Patna, India

What is an IR Sensor? IR sensor with Arduino and interface it with some components like an LED and a buzzer. We'll make a setup where the LED lights up and the buzzer sounds when motion is detected by the IR sensor. Components Needed. 1.Arduino board 2.IR sensor module 3.LED 4.Buzzer 5.Jumper wires Wiring Connections: Connect the VCC pin of the IR sensor module to the 5V pin of the Arduino. Connect the GND pin of the IR sensor module to the GND pin of the Arduino. Connect the OUT pin of the IR sensor module to digital pin 2 of the Arduino. Connect the positive (anode) leg of the LED to digital pin 3 of the Arduino through a current-limiting resistor (220-330 ohms). Connect the negative (cathode) leg of the LED to the GND pin of the Arduino. Connect one terminal of the buzzer to digital pin 4 of…

Read more

Python Conditional Statement

RevivingIndia Meena bazar, Patna, India

What is a Conditional Statement? Decision making statements in programming languages decides the direction of flow of program execution. Decision making statements available in python are also known as if..else statement VERSION OF IF ..ELSE STATMENT if statement if..else statements nested if statements Short Hand if-else statement IF STATEMENT It is used to decide whether a certain statement or block of statements will be executed or not. if condition: # Statements to execute if # condition is true IF- ELSE The elsestatement with ifstatement to execute a block of code when the condition is false. if (condition):   # Executes this block if   # condition is true else:   # Executes this block if   # condition is false IF-ELIF-ELSE The if statements are executed from the top down. As soon as one of the conditions controlling the if is true, the statement associated with that if is executed, and the…

Read more

CV Preparation

RevivingIndia Meena bazar, Patna, India

Objective: A recent graduate seeking an entry-level position to kickstart a career in . Eager to apply academic knowledge, demonstrate strong work ethic, and contribute positively to the team. Education: , , Relevant coursework: Highlight any courses directly related to your field of interest or industry. GPA: If notable, mention your GPA or any academic achievements. Skills: Technical Skills: Proficient in gained through coursework and projects. Soft Skills: Excellent communication skills, ability to work collaboratively in team environments, strong problem-solving skills, and a willingness to learn. Projects: , , , Developed , demonstrating proficiency in and ability to deliver results. Collaborated with peers to successfully complete , showcasing teamwork and project management abilities. Internships/Part-Time Jobs (if applicable): , , Assisted with , gaining practical experience in . Demonstrated initiative and a willingness to learn in a professional setting. Extracurricular Activities: , , Engaged in , showcasing leadership skills or organizational…

Read more

Practice Questions Conditional Statement

RevivingIndia Meena bazar, Patna, India

Write a Python program to check if a given number is greater than 10. Write a Python program to check if a given number is less than 5. Write a Python program to check if a given number is equal to 20. Write a Python program to check if a given number is not equal to 10. Write a Python program to check if a given number is between 1 and 10 (exclusive). Write a Python program to check if a given number is positive and even. Write a Python program to check if a given number is negative and odd. Write a Python program to check if a given year is a leap year using the modulo operator. Write a Python program to check if a given number is divisible by 4 and 6. Write a Python program to check if a given character is a vowel (a, e,…

Read more

Python Loop

RevivingIndia Meena bazar, Patna, India

Loops in Python In programming, loops are used to execute a block of code repeatedly. Python supports two main types of loops: for loops and while loops. For Loop: The for loop in Python is used to iterate over a sequence (such as a list, tuple, string, or range). It executes a block of code for each item in the sequence. for item in sequence: # Code block to be executed Example for i in range(1, 6): print(i) While Loop: The while loop in Python is used to execute a block of code as long as a condition is true. It repeatedly executes the code block until the condition becomes false. while condition: # Code block to be executed Example i = 1 while i <= 5: print(i) i += 1 Nested Loops: In Python, you can also have loops inside other loops, known as nested loops. They are used…

Read more

Python Loops Question

RevivingIndia Meena bazar, Patna, India

Write a Python program to print numbers from 1 to 5 using a for loop. Write a Python program to print numbers from 10 to 1 using a while loop. Write a Python program to print even numbers from 2 to 10. Write a Python program to print the sum of all numbers from 1 to 10. Write a Python program to print the product of all numbers from 1 to 5. Write a Python program to print the squares of numbers from 1 to 5. Write a Python program to print the cubes of numbers from 1 to 5. Write a Python program to print the reverse of a given list . Write a Python program to count the number of characters in a given string. Write a Python program to count the number of even numbers in a list . Write a Python program to find the factorial…

Read more

MySql Database

RevivingIndia Meena bazar, Patna, India

Relational Database Management System (RDBMS): Manages data organized into tables with rows and columns, using SQL for querying and manipulation. NoSQL: Databases diverging from the relational model, handling unstructured or semi-structured data, providing flexible schema designs. Graph Database: A type of NoSQL database using graph structures (nodes, edges, properties) for data representation and querying complex relationships efficiently. Installation Steps: 1. Download MySQL: Visit the official MySQL website: MySQL Downloads Under the MySQL Community (GPL) Downloads section, select the appropriate version for Windows. Choose the installer package according to your system architecture (32-bit or 64-bit). 2. Run the Installer: Once the installer is downloaded, double-click on the executable file to start the installation process. 3. Setup Wizard: The installation wizard will guide you through the installation process. Click "Next" to proceed. 4. Choose Setup Type: Select "Custom" setup type if you want to customize the installation options, otherwise, you can choose…

Read more

Flame Sensor

RevivingIndia Meena bazar, Patna, India

Flame Sensor: A flame sensor is a module used to detect the presence of fire or flames. It typically consists of an infrared (IR) sensor that detects the IR radiation emitted by flames. When flames are detected, the sensor outputs a digital signal to indicate the presence of fire. Interfacing with Arduino: To interface a flame sensor with an Arduino, you'll need to connect the sensor module to the Arduino board. The flame sensor typically has three pins: VCC (power), GND (ground), and OUT (signal). Here's how you can connect it: Connect the VCC pin of the flame sensor to the 5V pin on the Arduino. Connect the GND pin of the flame sensor to any GND pin on the Arduino. Connect the OUT pin of the flame sensor to a digital input pin on the Arduino (e.g., pin 2).   Code define FLAME_PIN 2 void setup() { Serial.begin(9600); pinMode(FLAME_PIN,…

Read more