Ask your own question, for FREE!
Computer Science
Gucchi:

programming help

Gucchi:

this is my programming assignment. i have picked option 1

1 attachment
Gucchi:

1 attachment
Gucchi:

this is what i have to include

Gucchi:

and my code should look like this:

1 attachment
Gucchi:

def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue)") print("This is the Gaming Addiction Club!") main()

Gucchi:

this is what i have written so far, but i need help with the rest.

Gucchi:

@smokeybrown

Gucchi:

@vocaloid can you guys help ?

Gucchi:

@ultrilliam

xXANIMELOVERXx:

So u r making a club for Gaming addiction?

xXANIMELOVERXx:

is that the club u r writing about?

xXANIMELOVERXx:

Hello??

Gucchi:

@xxanimeloverxx wrote:
So u r making a club for Gaming addiction?
yeah for the programming assignment

Gucchi:

i just came up with a random name

xXANIMELOVERXx:

ok

xXANIMELOVERXx:

lol

xXANIMELOVERXx:

anywho

xXANIMELOVERXx:

@gucchi wrote:
def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue)") print("This is the Gaming Addiction Club!") main()
So, this is everything u have so far?

Gucchi:

yeah

xXANIMELOVERXx:

ok

xXANIMELOVERXx:

So why dont you like write "You must be between the ages of 15 and 17 years old to join" or something like that bc it says that they must be a certian age of ur choice to join so yeah. Im just giving an example btw.

xXANIMELOVERXx:

Or u could put, "tell us a little bit about yourself" just so u know im not good at this kind of stuff but it seemed like u needed some help so...

Gucchi:

@extrinix can you help

Gucchi:

i

@xxanimeloverxx wrote:
Or u could put, "tell us a little bit about yourself" just so u know im not good at this kind of stuff but it seemed like u needed some help so...
im just waiting until smokeybrown gets on, hes the best explaining with this

xXANIMELOVERXx:

Oh ok lol

Gucchi:

so im trying to make an output just like this

1 attachment
Gucchi:

i just dont know how to code this tho

1 attachment
Gucchi:

like how do i make that list with user inputs

xXANIMELOVERXx:

ohhhh, then honestly i dont really know

xXANIMELOVERXx:

Im sorry.

Timmyspu:

@smokeybrown when you get on can you take a look at this.

Gucchi:

i hope he does man i really need help

Gucchi:

def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue for questions)") print("This is the Gaming Addiction Club!") age = int(input("Are you old enough for our club? What is your age?")) Liketoplay = input("Do you love to play video games?") print("Here are you application replies:") print("Age: " + str(age)) print("Love to play: " + str(Liketoplay)) if(age >= 13 and Liketoplay == "yes"): print("You can join our club!") else: print("You cannot join our club.") main() this is what i have rn

Gucchi:

and heres my output so far

1 attachment
SmokeyBrown:

Hi, and welcome back! It looks like you'll want to let the users to enter various input in order to get information about them. You'll save this information, then report it back to the user as output and display certain output based on the input you get. It seems like you're off to a good start so far! You've figured out how to save user input and report it back to them, and you also have a message that depends on the user input (whether their age is above or below a certain number). From here, I think you're ready to start adding more questions and saving those answers. Then, you can make your final judgment of whether or not the user can join the club based on all those conditions together (using logical AND, OR) I'll be back in a bit, but I'm going to eat dinner now. Keep up the good work :)

Gucchi:

and i also want to ask three more things like: favorite game genre, do you play with controller or keyboard, and something like "Do you play video games frequently?"

Gucchi:

ok i added my two questions def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue for questions)") print("This is the Gaming Addiction Club!") age = int(input("Are you old enough for our club? What is your age?")) Liketoplay = input("Do you love to play video games?") howplay = input("Do you play with a controller or keyboard? (answer with yes | no") whenplay = input("Do you play video games frequently? (answer with yes | no") print("Here are you application replies:") print("Age: " + str(age)) print("Love to play: " + str(Liketoplay)) print("Controller or keyboard?: " + str(howplay)) print("Do you play frequently?: " + str(whenplay)) if(age >= 13 and Liketoplay == "yes"): print("You can join our club!") else: print("You cannot join our club.") main()

Gucchi:

im working on it rn, but how would i put another if statement for howplay and whenplay

Gucchi:

after the else ?

Gucchi:

also i wanted to ask for a favorite game genre but im not sure how to do it

Gucchi:

so basically i wanted to include different genres like action, shooting, adventure for the user to input, so then the output can be something like this

1 attachment
SmokeyBrown:

In order to decide whether or not the person can join the club, I assume you would include the conditions of age; whether they like to play; what they use to play; and how often they like to play? If so, you can do something similar to your current condition ``` if(age >= 13 and Liketoplay == "yes"): ``` and add the conditions for howplay and whenplay in the same way: ``` if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"): ``` You can also consider including more detailed "You cannot join" messages if you want to specify the reason they cannot join, like in the example, though I guess that's not entirely necessary

Gucchi:

@smokeybrown wrote:
In order to decide whether or not the person can join the club, I assume you would include the conditions of age; whether they like to play; what they use to play; and how often they like to play? If so, you can do something similar to your current condition ``` if(age >= 13 and Liketoplay == "yes"): ``` and add the conditions for howplay and whenplay in the same way: ``` if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"): ``` You can also consider including more detailed "You cannot join" messages if you want to specify the reason they cannot join, like in the example, though I guess that's not entirely necessary
ohh ok ill try this then, and i just put a simple you cannot join message for now, but ill add a better one at the end

SmokeyBrown:

@gucchi wrote:
so basically i wanted to include different genres like action, shooting, adventure for the user to input, so then the output can be something like this
Sounds like a neat idea! If you don't need to make a condition based on their answer, I think it would be fine to let the user input anything. Then, it would be easy to just repeat it back to them. Something like ``` favoriteGenre = input("What is your favorite genre of game") ... print("Favorite genre: " + favoriteGenre) ``` On the other hand, if you need the user to input something specific, like, for example, to exclude people who enjoy fighting games (just a hypothetical!), you could make a list and prompt the user to choose from that list. That could look something more like ``` listGenres = ["action", "shooting", "adventure"] counter = 1 for genre in listGenres: print(str(counter) + " genre") counter += 1 favoriteGenre = input("Select the number of your favorite game genre") ``` And then you could use the number they select to match their choice to the genre from the list, if you needed it to check a condition or something. But if you only want to report their favorite genre back to the user, I think it should be fine to let the user input whatever they want, and it would be easier to code that

Gucchi:

def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue for questions)") age = int(input("Are you old enough for our club? What is your age?")) Liketoplay = input("Do you love to play video games?") howplay = input("Do you play with a controller or keyboard? (answer with yes | no") whenplay = input("Do you play video games frequently? (answer with yes | no") print("This is the Gaming Addiction Club!") print("") print("Here are you application replies:") print("Age: " + str(age)) print("Love to play: " + str(Liketoplay)) print("Controller or keyboard?: " + str(howplay)) print("Do you play frequently?: " + str(whenplay)) if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"): print("You can join our club!") else: print("") print("You cannot join our club.") main()

Gucchi:

my code so far

Gucchi:

thanks for that tip with the if statement it saved time

SmokeyBrown:

Glad to help :) I think it looks good so far! A couple of things I could nit-pick, but not necessarily problems: I was a little bit confused when I first read the "Do you play with a controller or keyboard?" question, since I thought it meant to choose a preference between controller or keyboard, as in, which do you like better? It could be reworded so the meaning is clearer, but since you clarify to respond with yes or no, it should be fine. The question about how frequently someone plays could be a number of hours per week rather than a yes/no question, but I actually think it's good that you let the person answering the survey decide whether or not they play frequently, instead of deciding an arbitrary cutoff value; no need to gatekeep based amount played, after all :) I wouldn't change anything there, just thinking out loud

Gucchi:

@smokeybrown wrote:
Glad to help :) I think it looks good so far! A couple of things I could nit-pick, but not necessarily problems: I was a little bit confused when I first read the "Do you play with a controller or keyboard?" question, since I thought it meant to choose a preference between controller or keyboard, as in, which do you like better? It could be reworded so the meaning is clearer, but since you clarify to respond with yes or no, it should be fine. The question about how frequently someone plays could be a number of hours per week rather than a yes/no question, but I actually think it's good that you let the person answering the survey decide whether or not they play frequently, instead of deciding an arbitrary cutoff value; no need to gatekeep based amount played, after all :) I wouldn't change anything there, just thinking out loud
i was going to do that with the frequently question but i didnt want to make it more difficult and confusing for myself, so i just left it simple like this. i also agree w you i will reword the controller one

SmokeyBrown:

Ok, sounds good. It could make the question easier to understand and answer, even if it makes sense as is. It looks like you've grasped the principles you need for this assignment, so I'll let you do your thing :) I'll try to check in from time to time, in case you need anything

Gucchi:

ok thank you, ill let u know when im done

Gucchi:

do i have to add the "favoritegenre" into this line aswell? if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"):

Gucchi:

after whenplay

SmokeyBrown:

@gucchi wrote:
do i have to add the "favoritegenre" into this line aswell? if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"):
You would check the value of favoritegenre there only if you wanted to use that condition to decide whether or not someone can join the club. Like, if there's certain genres you don't want the club to cater to, or maybe if you add the option for someone to say they don't like any games, that could make sense? Otherwise, you don't need it to be part of the condition, and you could just print it back as part of the output

Gucchi:

1 attachment
Gucchi:

i completely forgot abt this line

Gucchi:

i have to ask for the name and say something aftr

Gucchi:

how would i make it where i ask the user name and it saves it until the output to say something like the example

Gucchi:

i think ik but i forgot it somehow

SmokeyBrown:

Sure thing, it's very similar to what you've been doing with the other inputs you've set up. You could store the name with something like ``` name = input("What is your name?") ``` And then print a message like ``` print(name + " thank you for applying to be in the club") ``` Or whatever you want it to say

Gucchi:

@smokeybrown wrote:
@gucchi wrote:
so basically i wanted to include different genres like action, shooting, adventure for the user to input, so then the output can be something like this
Sounds like a neat idea! If you don't need to make a condition based on their answer, I think it would be fine to let the user input anything. Then, it would be easy to just repeat it back to them. Something like ``` favoriteGenre = input("What is your favorite genre of game") ... print("Favorite genre: " + favoriteGenre) ``` On the other hand, if you need the user to input something specific, like, for example, to exclude people who enjoy fighting games (just a hypothetical!), you could make a list and prompt the user to choose from that list. That could look something more like ``` listGenres = ["action", "shooting", "adventure"] counter = 1 for genre in listGenres: print(str(counter) + " genre") counter += 1 favoriteGenre = input("Select the number of your favorite game genre") ``` And then you could use the number they select to match their choice to the genre from the list, if you needed it to check a condition or something. But if you only want to report their favorite genre back to the user, I think it should be fine to let the user input whatever they want, and it would be easier to code that
i wanted to use the second one that you gave an example of but when i added that code, it showed this at the top

1 attachment
Gucchi:

@smokeybrown wrote:
@gucchi wrote:
do i have to add the "favoritegenre" into this line aswell? if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"):
You would check the value of favoritegenre there only if you wanted to use that condition to decide whether or not someone can join the club. Like, if there's certain genres you don't want the club to cater to, or maybe if you add the option for someone to say they don't like any games, that could make sense? Otherwise, you don't need it to be part of the condition, and you could just print it back as part of the output
wdym by check the value?

SmokeyBrown:

Oh, sorry, that's a typo on my part! The "genre" should be a variable, genre, without the quotation marks

Gucchi:

1 attachment
Gucchi:

i put fav genre as action but it says you cannot join the club

Gucchi:

even though the three genres added are action shooting and adventure

Gucchi:

def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue for questions)") name = input("What is your name?") age = int(input("Are you old enough for our club? What is your age?")) Liketoplay = input("Do you love to play video games?") listGenres = ["action", "shooting", "adventure"] counter = 1 for genre in listGenres: print(str(counter) + " genre") counter += 1 favoriteGenre = input("Select the number of your favorite game genre") howplay = input("How do you play video games? (controller | keyboard") whenplay = input("Do you play video games frequently? (answer with yes | no") print("This is the Gaming Addiction Club!") print("") print(name + " ,thank you for applying to be in the club!") print("") print("Here are you application replies:") print("Age: " + str(age)) print("Love to play: " + str(Liketoplay)) print("Favorite genre: " + str(favoriteGenre)) print("Controller or keyboard?: " + str(howplay)) print("Do you play frequently?: " + str(whenplay)) if(age >= 13 and Liketoplay == "yes" and howplay == "yes" and whenplay == "yes"): print("") print("You can join our club!") else: print("") print("You cannot join our club.") main()

Gucchi:

heres my code btw maybe im doin something wrong

SmokeyBrown:

By "check the value", I mean checking the information or the data to see if the input matches your condition. Like, if the condition needs the user to have a certain favorite genre, you would check to see that the information they gave matches that condition

SmokeyBrown:

@gucchi wrote:
i put fav genre as action but it says you cannot join the club
I see. It looks like you changed the "How do you play video games? (controller | keyboard" questions, but you haven't yet updated the condition for that question. In the if-condition, you're still checking that howplay == "yes", even though the options are no longer yes/no; it's now controller/keyboard. If you update the condition to be how you want it, the program should work

Gucchi:

is it supposed to show up on top like this tho?

1 attachment
Gucchi:

@smokeybrown wrote:
@gucchi wrote:
i put fav genre as action but it says you cannot join the club
I see. It looks like you changed the "How do you play video games? (controller | keyboard" questions, but you haven't yet updated the condition for that question. In the if-condition, you're still checking that howplay == "yes", even though the options are no longer yes/no; it's now controller/keyboard. If you update the condition to be how you want it, the program should work
do i type it like "controller/keyboard" on the line?

SmokeyBrown:

@gucchi wrote:
is it supposed to show up on top like this tho?
That's interesting. Based on your code, it looks like the list should print after the "Do you love to play video games?" question and before the "Select the number of your favorite game genre" question. Hmm...

SmokeyBrown:

@gucchi wrote:
do i type it like "controller/keyboard" on the line?
I think either "controller/keyboard" or "controller|keyboard" works fine. As long as it's clear and consistent with the rest of the questions, the meaning is the same, right?

Gucchi:

@smokeybrown wrote:
@gucchi wrote:
do i type it like "controller/keyboard" on the line?
I think either "controller/keyboard" or "controller|keyboard" works fine. As long as it's clear and consistent with the rest of the questions, the meaning is the same, right?
yeah it worked with controller/keyboard

Gucchi:

but this favoritegenre thing is the confusing part now

SmokeyBrown:

Yeah, I'm confused that the output appeared like that, with the list printing at the top of the output.... Are there other parts that are confusing too?

Gucchi:

@smokeybrown wrote:
@gucchi wrote:
so basically i wanted to include different genres like action, shooting, adventure for the user to input, so then the output can be something like this
Sounds like a neat idea! If you don't need to make a condition based on their answer, I think it would be fine to let the user input anything. Then, it would be easy to just repeat it back to them. Something like ``` favoriteGenre = input("What is your favorite genre of game") ... print("Favorite genre: " + favoriteGenre) ``` On the other hand, if you need the user to input something specific, like, for example, to exclude people who enjoy fighting games (just a hypothetical!), you could make a list and prompt the user to choose from that list. That could look something more like ``` listGenres = ["action", "shooting", "adventure"] counter = 1 for genre in listGenres: print(str(counter) + " genre") counter += 1 favoriteGenre = input("Select the number of your favorite game genre") ``` And then you could use the number they select to match their choice to the genre from the list, if you needed it to check a condition or something. But if you only want to report their favorite genre back to the user, I think it should be fine to let the user input whatever they want, and it would be easier to code that
instead of using the second one, cant we just use the first code for it?

Gucchi:

it wont be specific but ig it works

SmokeyBrown:

Yeah, I think the first code, just letting the user enter their own answer, works fine. Especially if you don't want to use the favoritegenre variable for anything other than printing it back in the output Honestly, I just wanted to flex a little bit by showing another way to do things :)

Gucchi:

@smokeybrown wrote:
Yeah, I think the first code, just letting the user enter their own answer, works fine. Especially if you don't want to use the favoritegenre variable for anything other than printing it back in the output Honestly, I just wanted to flex a little bit by showing another way to do things :)
yeah anything works at this point

Gucchi:

def main(): answer = input("This is the Gaming Addiction Club! Our club is dedicated with everything gaming, and we consistently host tournaments with members for prizes. We are glad you are trying to apply because we are currently looking for new members everyday! (type f to continue for questions)") name = input("What is your name?") age = int(input("Are you old enough for our club? What is your age?")) Liketoplay = input("Do you love to play video games?") favoriteGenre = input("What is your favorite genre of video games?") howplay = input("How do you play video games? (controller | keyboard") whenplay = input("Do you play video games frequently? (answer with yes | no") print("This is the Gaming Addiction Club!") print("") print(name + " thank you for applying to be in the club!") print("") print("Here are you application replies:") print("Age: " + str(age)) print("Love to play: " + str(Liketoplay)) print("Favorite genre: " + str(favoriteGenre)) print("Controller or keyboard?: " + str(howplay)) print("Do you play frequently?: " + str(whenplay)) if(age >= 13 and Liketoplay == "yes" and howplay == "controller/keyboard" and whenplay == "yes"): print("") print("You can join our club!") else: print("") print("Sadly, you do not meet the requirements to join the Gaming Addiction Club at this time.") main()

Gucchi:

i added this to it

1 attachment
Gucchi:

but it still doesnt meet the requirements

1 attachment
SmokeyBrown:

Oh, gotcha, I think I was a little misleading with how I said to write the conditions earlier. If you want the condition to be that someone can join if they play with a controller or a keyboard, that part of the condition would be more like ...and (howplay == "controller" or howplay == "keyboard")... Similarly, if you want someone to be able to join when they input any of those specific genres, the condition would be similar to ...and (favoritegenre == "action" or favoritegenre == "adventure" or favoritegenre == "racing")...

Gucchi:

1 attachment
Gucchi:

is there something wrong on the line?

SmokeyBrown:

That's interesting. I guess there's probably something wrong with the syntax to get that error message, but it looks ok to me...

SmokeyBrown:

Oh, I got it. There's a missing closing parentheses at the end of the line. So, it should be ..."racing")):

Gucchi:

perfect that was the issue

Gucchi:

i think thats it, i dont think theres anything else

SmokeyBrown:

Awesome! Great job coding it out :)

Gucchi:

thank you, idk why this took so long tho

Gucchi:

ive been working on it all day lol

Gucchi:

imma be working on one more in a few so if you are still online, ill tag you if i need anything

Gucchi:

its not as long i think its short but yh

SmokeyBrown:

Ok, sounds like a plan!

Gucchi:

i have to rush since i need this done by friday

Gucchi:

@smokeybrown wrote:
Ok, sounds like a plan!
thanks bro

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!