473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

last 2 songs in python will not play only the first 2 if i try and play the 3rd or 4t

i added 2 more songs and now it wont play the last 2 if i type "Where You Been" witch is the last one it plays the "Trigger Finger" and it also does that with the "Crack" one but it will play "Fork" when i type it im confused how it only lets me play the first two there is no errors here is my code...
Expand|Select|Wrap|Line Numbers
  1. import pygame
  2. from pygame.locals import *
  3.  
  4. pygame.mixer.init()
  5. start = 1
  6. chainz_1 = pygame.mixer.Sound("fork.ogg")
  7. lilwayne_1 = pygame.mixer.Sound("TF.ogg")
  8. chainz_2 = pygame.mixer.Sound("Crack.ogg")
  9. chainz_3 = pygame.mixer.Sound("WhereYouBeen.ogg")
  10.  
  11. while True:
  12.     print("What song would you like to play? ")
  13.     print("Fork")
  14.     print("Trigger Finger")
  15.     print("Crack")
  16.     print("Where You been")
  17.     choice = input()
  18.  
  19.     if choice == "Fork":
  20.       chainz_1.set_volume(0.2)
  21.       chainz_1.play()
  22.       wn = input()
  23.       if wn == "Stop" or "stop":
  24.       chainz_1.stop()
  25.       continue
  26.     if choice == "Trigger Finger" or "tf" or "trigger finger":
  27.       lilwayne_1.set_volume(0.15)
  28.       lilwayne_1.play()
  29.       wn = input()
  30.       if wn == "Stop" or "stop":
  31.       lilwayne_1.stop()
  32.       continue
  33.     if choice == "Crack" or "crack":
  34.       chainz_2.set_volume(0.2)
  35.       chainz_2.play()
  36.       wn = input()
  37.       if wn == "Stop" or "stop":
  38.       chainz_2.stop()
  39.       continue
  40.     if choice == "Where You Been" or "where you been" or "wyb":
  41.       chainz_3.set_volume(0.2)
  42.       chainz_3.play()
  43.       wn = input()
  44.       if wn == "Stop" or "stop":
  45.       chainz_3.stop()
  46.       continue
  47.  
Oct 29 '14 #1
2 1233
Rabbit
12,516 Expert Mod 8TB
This
Expand|Select|Wrap|Line Numbers
  1. if choice == "Trigger Finger" or "tf" or "trigger finger":
Needs to be this
Expand|Select|Wrap|Line Numbers
  1. if choice == "Trigger Finger" or choice == "tf" or choice == "trigger finger":
The same goes for the rest of your code.
Oct 29 '14 #2
dwblas
626 Expert 512MB
It is simpler when using numbers
Expand|Select|Wrap|Line Numbers
  1.     print("What song would you like to play? ")
  2.     print("""
  3. 1. Fork
  4. 2. Trigger Finger
  5. 3. Crack
  6. 4. Where You been
  7. """
  8.      choice = input("Enter 1->4 ")
  9.      choice = int(choice)
  10.  
  11.      if choice == 1:
  12.        chainz_1.set_volume(0.2)
  13.        chainz_1.play()
  14. ##
  15. ## etc. 
Oct 30 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Brian Quinlan | last post by:
I've decided that it would be be fun to host a weekly Python programming contest. The focus will be on algorithms that require a bit of thought to design but not much code to implement. I'm...
0
by: Jarek Zgoda | last post by:
I was missing miscellaneous Python group on last.fm, so here it is: http://www.last.fm/group/PythonCode. Enjoy. -- Jarek Zgoda http://jpa.berlios.de/
0
by: lhuisingh | last post by:
I have a data grid in my C# Windows Form. All but the last column can be resized during program execution. If the resized column reaches the right edge of the grid control I can scroll...
0
by: Fuzzyman | last post by:
http://home.inklingmarkets.com/market/show/4018 (Interesting site by the way - although a bit heavily weighted towards US politics for my tastes). Anyway, I know which way my money is going...
29
by: jmDesktop | last post by:
For students 9th - 12th grade, with at least Algebra I. Do you think Python is a good first programming language for someone with zero programming experience? Using Linux and Python for first...
0
by: Mike Driscoll | last post by:
Hi all, The first meeting date for the Iowa Python Users Group has been decided. Here are the details: ------------------------------------------------------------ Time / Date: Wednesday,...
15
by: asm23 | last post by:
Hi, everyone, I'm studying the <<Thinking in C++>volume Two. In Chapter One, the example code : Auto_ptr.cpp //------------------------------------------------------- #include <memory> #include...
0
by: James Kanze | last post by:
On Oct 6, 3:59 pm, microcassanova <mangal.pa...@gmail.comwrote: I presume you mean explicit, but what does that change? And what is the relationship with data loss. (Most of my...
3
by: Mo Ewing | last post by:
I have a field in my database with people's names. Each field has only one first name but may have more than one last name. The first name is always the first word in the field. I would like to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.