SlideShare a Scribd company logo
1 of 4
PYTHON SCRIPTS
Kenway
import random
WORDS = ("python", "jumble", "easy", "difficult", "answer" "xylophone")
word = random.choice (WORDS)
correct = word
jumble = ""
while word:
position = random.randrange (len(word) )
jumble += word[position]
word = word[:position] + word[(position + 1):]
print(
"""
welcome to word jumble!
Unsramble the letters to make a word.
(press the enter key at the prompt to quit.)
"""
)
print("The jumble is:", jumble)
guess = input ("nYour Guess: ")
while guess != correct and guess != "":
print("Sorry, that's not it.")
guess = input ("your guess: ")
print ("Thanks for playing.“)

WHILE LOOP
# Mood Computer
# Demonstrates the elif clause
import random
print("I sense your energy. Your true emotions are coming across my screen.")
print("You are..")
mood = random.randint(1, 3)
if mood == 1:
# happy
print ( 
""" :D """)
elif mood == 2:
# neutral
print ( 
""" -_- """)
elif mood == 3:
# sad
print ( 
""" :( """)
else:
print("Illegal mood value! (You must be in a really bad mood).")
print ("....today")
input("nnPress the enter key to exit.")

IF LOOP
message = input("Enter Message: ")
print("nThe length of your message is:", len(message) )
print("n the most common letter in the english language is, 'e', ")
if "e" in message:
print("is in your message.")
else:
print("is not in your message.")

IF ELSE LOOP

More Related Content

What's hot (16)

Vuvuzela flow and wireframes
Vuvuzela   flow and wireframesVuvuzela   flow and wireframes
Vuvuzela flow and wireframes
 
Block wars 3 d
Block wars 3 dBlock wars 3 d
Block wars 3 d
 
Elliot Black 3D game Workflow
Elliot Black 3D game WorkflowElliot Black 3D game Workflow
Elliot Black 3D game Workflow
 
Ig1 task 2 analysis work sheet111
Ig1 task 2 analysis work sheet111 Ig1 task 2 analysis work sheet111
Ig1 task 2 analysis work sheet111
 
Sound game maker explanations
Sound game maker explanationsSound game maker explanations
Sound game maker explanations
 
1. initial plans(2)
1. initial plans(2)1. initial plans(2)
1. initial plans(2)
 
Game interface
Game interfaceGame interface
Game interface
 
Task 11 programming sounds into my game
Task 11 programming sounds into my gameTask 11 programming sounds into my game
Task 11 programming sounds into my game
 
Sound programme process
Sound programme processSound programme process
Sound programme process
 
game project-research
game project-researchgame project-research
game project-research
 
Website comparison
Website comparisonWebsite comparison
Website comparison
 
Info
InfoInfo
Info
 
Print screen
Print screenPrint screen
Print screen
 
Assignment C
Assignment C Assignment C
Assignment C
 
Shot over kill terrorist
Shot over kill terroristShot over kill terrorist
Shot over kill terrorist
 
Instructions pc virtual
Instructions pc virtualInstructions pc virtual
Instructions pc virtual
 

Viewers also liked

Application form a zse
Application form a zseApplication form a zse
Application form a zse
Peter Sevce
 
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iitPankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
PANKAJ JAIN
 
Ekonomický týždenník 11. týždeň 2014
Ekonomický týždenník 11. týždeň 2014Ekonomický týždenník 11. týždeň 2014
Ekonomický týždenník 11. týždeň 2014
pabk
 

Viewers also liked (20)

Application form a zse
Application form a zseApplication form a zse
Application form a zse
 
Ekonomický týždenník Poštovej banky - 17. týždeň, 2015
Ekonomický týždenník Poštovej banky - 17. týždeň, 2015Ekonomický týždenník Poštovej banky - 17. týždeň, 2015
Ekonomický týždenník Poštovej banky - 17. týždeň, 2015
 
Ekonomický týždenník Poštovej banky - 14. týždeň, 2015
Ekonomický týždenník Poštovej banky - 14. týždeň, 2015Ekonomický týždenník Poštovej banky - 14. týždeň, 2015
Ekonomický týždenník Poštovej banky - 14. týždeň, 2015
 
Trabajo
TrabajoTrabajo
Trabajo
 
10.hafta sunu
10.hafta sunu10.hafta sunu
10.hafta sunu
 
Six step for partners
Six step for partnersSix step for partners
Six step for partners
 
Ekonomický týždenník Poštovej banky - 24. týždeň
Ekonomický týždenník Poštovej banky - 24. týždeňEkonomický týždenník Poštovej banky - 24. týždeň
Ekonomický týždenník Poštovej banky - 24. týždeň
 
Life & blood of entrepreneurship
Life & blood of entrepreneurshipLife & blood of entrepreneurship
Life & blood of entrepreneurship
 
Bewakoofiyaan Movie Photos
Bewakoofiyaan Movie PhotosBewakoofiyaan Movie Photos
Bewakoofiyaan Movie Photos
 
Ekonomický týždenník Poštovej banky - 11. týždeň, 2015
Ekonomický týždenník Poštovej banky - 11. týždeň, 2015Ekonomický týždenník Poštovej banky - 11. týždeň, 2015
Ekonomický týždenník Poštovej banky - 11. týždeň, 2015
 
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iitPankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
Pankaj jain senior_manager_(development_&_support)_11.5_yr_mba_iit_b_tech_iit
 
Stvorimo bolji internet zajedno
Stvorimo bolji internet zajednoStvorimo bolji internet zajedno
Stvorimo bolji internet zajedno
 
ИБ эпохи перемен
ИБ эпохи переменИБ эпохи перемен
ИБ эпохи перемен
 
Ekonomický týždenník 11. týždeň 2014
Ekonomický týždenník 11. týždeň 2014Ekonomický týždenník 11. týždeň 2014
Ekonomický týždenník 11. týždeň 2014
 
итоговая презентация
итоговая презентацияитоговая презентация
итоговая презентация
 
"Re-Thinking Social Inequality" - Documentation Herrenhausen Conference
"Re-Thinking Social Inequality" - Documentation Herrenhausen Conference"Re-Thinking Social Inequality" - Documentation Herrenhausen Conference
"Re-Thinking Social Inequality" - Documentation Herrenhausen Conference
 
Nimcet 2014
Nimcet 2014Nimcet 2014
Nimcet 2014
 
Hindustan Newsprint Limited : Qualified candidates in different Trades/Discip...
Hindustan Newsprint Limited : Qualified candidates in different Trades/Discip...Hindustan Newsprint Limited : Qualified candidates in different Trades/Discip...
Hindustan Newsprint Limited : Qualified candidates in different Trades/Discip...
 
Taller de cake pops
Taller de cake popsTaller de cake pops
Taller de cake pops
 
Презентация для родительского собрания
Презентация для родительского собранияПрезентация для родительского собрания
Презентация для родительского собрания
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Python scripts

  • 2. import random WORDS = ("python", "jumble", "easy", "difficult", "answer" "xylophone") word = random.choice (WORDS) correct = word jumble = "" while word: position = random.randrange (len(word) ) jumble += word[position] word = word[:position] + word[(position + 1):] print( """ welcome to word jumble! Unsramble the letters to make a word. (press the enter key at the prompt to quit.) """ ) print("The jumble is:", jumble) guess = input ("nYour Guess: ") while guess != correct and guess != "": print("Sorry, that's not it.") guess = input ("your guess: ") print ("Thanks for playing.“) WHILE LOOP
  • 3. # Mood Computer # Demonstrates the elif clause import random print("I sense your energy. Your true emotions are coming across my screen.") print("You are..") mood = random.randint(1, 3) if mood == 1: # happy print ( """ :D """) elif mood == 2: # neutral print ( """ -_- """) elif mood == 3: # sad print ( """ :( """) else: print("Illegal mood value! (You must be in a really bad mood).") print ("....today") input("nnPress the enter key to exit.") IF LOOP
  • 4. message = input("Enter Message: ") print("nThe length of your message is:", len(message) ) print("n the most common letter in the english language is, 'e', ") if "e" in message: print("is in your message.") else: print("is not in your message.") IF ELSE LOOP