SlideShare a Scribd company logo
5
Most read
6
Most read
7
Most read
Brain Storming Techniques For
Logic Development Using Lists
Tuples Strings And Dictionaries
In Python
Brainstorming is an activity
that helps to
What is Brainstorming in Programmming?
• Produce a large number of ideas
• Generate ideas quickly
• Build enthusiasm
• Solve tricky problems
Rules of Brainstorming in Class
Defer judgment
Encourage wild ideas
Build on the ideas of others
Stay focused on the topic
One conversation at a time
Facilitate visual thinking
Go for quantity
Brainstorming
Techniques in
Programming
Mind
Mapping
Brain Writing
Output based
reverse
brainstorming
Dry Run
Working with Python Lists
• Program 1: Take a list of 8 elements. Split it into middle and store the
elements in two different lists.
• Find length of the list.
• Run a loop from first
element till the half
while copying to
another list
• Copy the rest to a third
list
Method 1 Method 2
a=[22,33,44,55,66,77,88,99]
l=len(a)
m=l//2
print(a[:m])
print(a[m:])
Requires 2 loops
Working with Python Lists
• Program : Delete duplicate values from a tuple
X=[1,2,2,3,4,4,5,5,6,
7,8,8]
i=0
while i<len(x):
j=i+1
while j<len(x):
if
x[i]==x[j]:
del(x[j])
j=j+1
i=i+1
print(x)
Method 1 Method 2
x=(1,2,2,3,4,4,5,5,6,7,8,8)
y=list(set(x))
print(y)
Requires nested
loops
The set() method converts any of
the iterable to a distinct sequence
of iterable elements
Zip() :creating a dictionary lookalike from
Tuples
• Program : To group different data values to form tuples.
name=("Preeti", "Asha","Juli", "Kary")
score=(45,34,89,74)
term=("I","II","II","I")
status=("F","F","P","P")
result=zip(name,score,term,status)
print(tuple(result))
Swapping: can be used with all the types
• Program: Names of two students have been swapped. Correct them.
Stud_science="Preeti Mathur"
Stud_commerce="Agastya Gupta"
Stud_science,Stud_commerce=Stud_commerce,Stud_science
print("Sience student is",Stud_science)
print("Commerce Student is ",Stud_commerce)
Palindrome
• Program : To check if a string is a Palindrome or not.
s=input("Enter String")
y=s[::-1]
if s==y:
print("Palindrome")
else:
print("Not Palindrome")
string=input("Enter a String")
k=len(string)
t=k//2
flag=True
i=0
j=k-1
for m in range(t):
if string[i]!=string[j]:
flag=False
i=i+1
j=j-1
if flag==True:
print("Palindrome")
else:
print("Not a Palindrome")
Method 1 Method 2
Join in strings
• Program :Add a space in between all the letters of a string.
s1=input("Enter a String")
s2=" ".join(s1)
print(s2)
Strings and slicing: swapping halves
• Program to swap the first and second half of a string.
str=input("Enter a string")
print(str)
l=len(str)
h=l//2
fh=str[:h]
sh=str[h:]
fh,sh=sh,fh
s=fh + sh
print(s)
Reverse a string
• Program. Input a string and reverse it
str=input("Enter a string")
st=str[::-1]
print(st)
Pattern Printing
• Program: Printing a Pattern of ‘*’.
pattern="*"
for i in range(4):
print(pattern*(i+1))
Alternate elements
• Program : To print alternate elements in a list.
list1=[2,3,5,6,7,8,9]
print(list1[::2])
Creating Dictionaries from input
• Program: Create a record of students with marks in two subjects.
d1=dict()
for i in range(4):
name=input("enter name")
m1=int(input("Enter m1"))
m2=int(input("Enter m2"))
d1[name]=[m1,m2]
print(d1)
• https://www.slideshare.net/NeeruMittal4
To access this presentation and others

More Related Content

PPT
Introduction to Python
PPTX
Context free grammar
PPTX
Data Types, Variables, and Operators
PPTX
Algorithm Introduction
PPTX
Data Types and Variables In C Programming
PPTX
Eucledian algorithm for gcd of integers and polynomials
PDF
Python-01| Fundamentals
PPTX
Arrays in java
Introduction to Python
Context free grammar
Data Types, Variables, and Operators
Algorithm Introduction
Data Types and Variables In C Programming
Eucledian algorithm for gcd of integers and polynomials
Python-01| Fundamentals
Arrays in java

What's hot (20)

PPTX
JavaScript Conditional Statements
PPTX
Python 3 Programming Language
PPTX
Python | What is Python | History of Python | Python Tutorial
PPTX
Quick sort
PPT
Sequences and series
PPTX
Arrays In C++
PPT
Python ppt
PPTX
JAVA LOOP.pptx
PDF
Python Programming by Dr. C. Sreedhar.pdf
PPTX
Python strings presentation
PPT
Lecture 5 sorting and searching
PPTX
Unit 1 of c++ part 1 basic introduction
PPTX
Functions in Python
PPTX
Python dictionary
PDF
Python basic
PPTX
Arrays in Java
PPTX
Operators and Control Statements in Python
JavaScript Conditional Statements
Python 3 Programming Language
Python | What is Python | History of Python | Python Tutorial
Quick sort
Sequences and series
Arrays In C++
Python ppt
JAVA LOOP.pptx
Python Programming by Dr. C. Sreedhar.pdf
Python strings presentation
Lecture 5 sorting and searching
Unit 1 of c++ part 1 basic introduction
Functions in Python
Python dictionary
Python basic
Arrays in Java
Operators and Control Statements in Python
Ad

Similar to Brain Storming techniques in Python (20)

PPTX
Basic Python Programming: Part 01 and Part 02
PDF
Python Tutorial
PDF
HT18 - DA361A - Kursintroduktion
PPTX
Programming in Python
PPTX
python programming for beginners and advanced
PPTX
Functions, List and String methods
PPT
chap 06 hgjhg hghg hh ghg jh jhghj gj g.ppt
PPTX
Python Workshop - Learn Python the Hard Way
PPTX
PPTX
Python Basic for Data science enthusiast
PPTX
Learning with classification and clustering, neural networks
PPTX
Core Concept_Python.pptx
PDF
Bootcamp Code Notes - Akshansh Chaudhary
PPTX
Python programming computer science and engineering
PPTX
Python Interview Questions | Python Interview Questions And Answers | Python ...
PPTX
Python introduction
PPT
M18 learning
PDF
Domain Driven Design Made Functional with Python
PPTX
Prolog 7-Languages
PPTX
Object Oriented Programming in Python.pptx
Basic Python Programming: Part 01 and Part 02
Python Tutorial
HT18 - DA361A - Kursintroduktion
Programming in Python
python programming for beginners and advanced
Functions, List and String methods
chap 06 hgjhg hghg hh ghg jh jhghj gj g.ppt
Python Workshop - Learn Python the Hard Way
Python Basic for Data science enthusiast
Learning with classification and clustering, neural networks
Core Concept_Python.pptx
Bootcamp Code Notes - Akshansh Chaudhary
Python programming computer science and engineering
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python introduction
M18 learning
Domain Driven Design Made Functional with Python
Prolog 7-Languages
Object Oriented Programming in Python.pptx
Ad

More from Neeru Mittal (19)

PPTX
Using the Word Wheel to Learn basic English Vocabulary
PPTX
Machine Learning
PPTX
Introduction to AI and its domains.pptx
PPTX
Data Analysis with Python Pandas
PPTX
Python Tips and Tricks
PPTX
Python and CSV Connectivity
PPTX
Working of while loop
PPTX
Increment and Decrement operators in C++
PPTX
Library functions in c++
PPTX
Strings in c++
PPTX
Two dimensional arrays
PPTX
Arrays
PPTX
Nested loops
PPTX
Iterative control structures, looping, types of loops, loop working
PPTX
Variables in C++, data types in c++
PPTX
Operators and expressions in C++
PPTX
Introduction to programming
PPTX
Getting started in c++
PPTX
Introduction to Selection control structures in C++
Using the Word Wheel to Learn basic English Vocabulary
Machine Learning
Introduction to AI and its domains.pptx
Data Analysis with Python Pandas
Python Tips and Tricks
Python and CSV Connectivity
Working of while loop
Increment and Decrement operators in C++
Library functions in c++
Strings in c++
Two dimensional arrays
Arrays
Nested loops
Iterative control structures, looping, types of loops, loop working
Variables in C++, data types in c++
Operators and expressions in C++
Introduction to programming
Getting started in c++
Introduction to Selection control structures in C++

Recently uploaded (20)

PPTX
Lesson notes of climatology university.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
master seminar digital applications in india
PPTX
Cell Types and Its function , kingdom of life
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Basic Mud Logging Guide for educational purpose
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Institutional Correction lecture only . . .
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Structure & Organelles in detailed.
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Sports Quiz easy sports quiz sports quiz
Lesson notes of climatology university.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
VCE English Exam - Section C Student Revision Booklet
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
master seminar digital applications in india
Cell Types and Its function , kingdom of life
Renaissance Architecture: A Journey from Faith to Humanism
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Basic Mud Logging Guide for educational purpose
GDM (1) (1).pptx small presentation for students
Institutional Correction lecture only . . .
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Anesthesia in Laparoscopic Surgery in India
Cell Structure & Organelles in detailed.
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Sports Quiz easy sports quiz sports quiz

Brain Storming techniques in Python

  • 1. Brain Storming Techniques For Logic Development Using Lists Tuples Strings And Dictionaries In Python
  • 2. Brainstorming is an activity that helps to What is Brainstorming in Programmming? • Produce a large number of ideas • Generate ideas quickly • Build enthusiasm • Solve tricky problems
  • 3. Rules of Brainstorming in Class Defer judgment Encourage wild ideas Build on the ideas of others Stay focused on the topic One conversation at a time Facilitate visual thinking Go for quantity
  • 5. Working with Python Lists • Program 1: Take a list of 8 elements. Split it into middle and store the elements in two different lists. • Find length of the list. • Run a loop from first element till the half while copying to another list • Copy the rest to a third list Method 1 Method 2 a=[22,33,44,55,66,77,88,99] l=len(a) m=l//2 print(a[:m]) print(a[m:]) Requires 2 loops
  • 6. Working with Python Lists • Program : Delete duplicate values from a tuple X=[1,2,2,3,4,4,5,5,6, 7,8,8] i=0 while i<len(x): j=i+1 while j<len(x): if x[i]==x[j]: del(x[j]) j=j+1 i=i+1 print(x) Method 1 Method 2 x=(1,2,2,3,4,4,5,5,6,7,8,8) y=list(set(x)) print(y) Requires nested loops The set() method converts any of the iterable to a distinct sequence of iterable elements
  • 7. Zip() :creating a dictionary lookalike from Tuples • Program : To group different data values to form tuples. name=("Preeti", "Asha","Juli", "Kary") score=(45,34,89,74) term=("I","II","II","I") status=("F","F","P","P") result=zip(name,score,term,status) print(tuple(result))
  • 8. Swapping: can be used with all the types • Program: Names of two students have been swapped. Correct them. Stud_science="Preeti Mathur" Stud_commerce="Agastya Gupta" Stud_science,Stud_commerce=Stud_commerce,Stud_science print("Sience student is",Stud_science) print("Commerce Student is ",Stud_commerce)
  • 9. Palindrome • Program : To check if a string is a Palindrome or not. s=input("Enter String") y=s[::-1] if s==y: print("Palindrome") else: print("Not Palindrome") string=input("Enter a String") k=len(string) t=k//2 flag=True i=0 j=k-1 for m in range(t): if string[i]!=string[j]: flag=False i=i+1 j=j-1 if flag==True: print("Palindrome") else: print("Not a Palindrome") Method 1 Method 2
  • 10. Join in strings • Program :Add a space in between all the letters of a string. s1=input("Enter a String") s2=" ".join(s1) print(s2)
  • 11. Strings and slicing: swapping halves • Program to swap the first and second half of a string. str=input("Enter a string") print(str) l=len(str) h=l//2 fh=str[:h] sh=str[h:] fh,sh=sh,fh s=fh + sh print(s)
  • 12. Reverse a string • Program. Input a string and reverse it str=input("Enter a string") st=str[::-1] print(st)
  • 13. Pattern Printing • Program: Printing a Pattern of ‘*’. pattern="*" for i in range(4): print(pattern*(i+1))
  • 14. Alternate elements • Program : To print alternate elements in a list. list1=[2,3,5,6,7,8,9] print(list1[::2])
  • 15. Creating Dictionaries from input • Program: Create a record of students with marks in two subjects. d1=dict() for i in range(4): name=input("enter name") m1=int(input("Enter m1")) m2=int(input("Enter m2")) d1[name]=[m1,m2] print(d1)