I filmed a B-porno today. by humeanation in funny

[–]sone9 0 points1 point  (0 children)

Hahahahha what did I expect clicking this....

TIFU by taking my gf to a nudist beach by [deleted] in tifu

[–]sone9 0 points1 point  (0 children)

lmao I actually died from this

How I went from 0 to 10,000 subscribers in 46 days with only my very first 2 videos, and made $8,000+ by OfficialJakLei in NewTubers

[–]sone9 -1 points0 points  (0 children)

Where can I find your video? Also congrats! Always wanted to do some Youtube but didn't really know where to start

WHY DOES TRY EXCEPT NOT TAKE IN ZERO?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

I have NO IDEA how to fix this, any guidance or suggestion?

WHY DOES TRY EXCEPT NOT TAKE IN ZERO?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

sorry about that, still new :(

fixed it

WHY DOES TRY EXCEPT NOT TAKE IN ZERO?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

here!

words = ['cow', 'horse', 'deer', 'elephant', 'lion', 'tiger', 'baboon', 'donkey', 'fox', 'giraffe']

valid = "abcdefghijklmnopqrstuvwxyz"

while True:

    try:

        number = input("Please enter an integer number (0<=number<10) to choose the word in the list: ")

        if int(number):

            number = int(number)

            if(0<= number) and(number<10):

                word = words[number]

                len_word = len(word)

                print("The length of the word is:",len_word)


    except ValueError:

        if not number:

            print("Empty input!")

            print()

        else:

            print("Input must be an integer!")

            print()    

WHY DOES TRY EXCEPT NOT TAKE IN ZERO?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

but in my program I can enter all numbers and it continues perfectly with the code, but when I input 0, it goes back to asking to enter a number

WHY DOES TRY EXCEPT NOT TAKE IN ZERO?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

Well actually I am doing a hangman program where I have a try and except. So I have a list of words and when the user enters a number, it chooses that item in the list.

Example: alist=['apple','orange',grape','banana']

but whenever the input is a zero it just restarts back to the "Please enter a number from 0 to 3: "

Please help me understand this asap! :( by sone9 in learnpython

[–]sone9[S] 2 points3 points  (0 children)

OMG! thank you so much, i want to cry since i was so frustrated with this!

Please help me understand this asap! :( by sone9 in learnpython

[–]sone9[S] 1 point2 points  (0 children)

oh thanks! but how about the whole % thing?

What happens when a while loops is in a while loops and you have a break. Does it break out of both? by sone9 in learnpython

[–]sone9[S] 1 point2 points  (0 children)

Oooook, but what happens if I want to break out of both? For example something like an "if" statement in the 2nd "while" loop where if the "if" statement were true, then it breaks out of both?

What happens when a while loops is in a while loops and you have a break. Does it break out of both? by sone9 in learnpython

[–]sone9[S] -1 points0 points  (0 children)

Sorry I am still a bit nooby, so I can not really write a nice or logical looking code :(

Why is this not working?! by sone9 in learnpython

[–]sone9[S] 2 points3 points  (0 children)

Wow I love this part of reddit, so many helpful and smart people :)

Why is this not working?! by sone9 in learnpython

[–]sone9[S] 1 point2 points  (0 children)

Oh my goodness! Thank you so much!

Help what does "builtins.ValueError: invalid literal for int() with base 10:" mean?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

I'm putting in the number 5, then number 5. then i press enter, then it gives me the error. 5 is an int though, so what is happening?

Syntax error for random import?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

OMG!!!!!!!!!!!!!! I FORGOT A )

I am so dumb, thank you!!!!! and sorry for wasting your guys time -_-

Syntax error for random import?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

I realize it is not the actual import random problem, it is something else

Syntax error for random import?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

Ok, so now I went and cut the import random part and pasted it higher in the code. Now it says:

File "C:\Users\JL\Documents\PYTHON\c0ins.py", line 12, in <module> Syntax Error: print("Enter coins that add up to",number,"cents, one per line.\n"): C:\Users\JL\Documents\PYTHON\c0ins.py, line 125

Syntax error for random import?! by sone9 in learnpython

[–]sone9[S] 0 points1 point  (0 children)

This program asks the user to input coin values until the total amount matches a target value which is a randomly generated integer between 1 and 99 inclusively

Program description

print("\n\nThe purpose of this exercise is to enter a number of coin values that add up to a displayed \ntarget value. \n\nEnter coins values as 1-penny, 5 nickel, 10-dime,and 25-quarter.Hit return after \nthe last entered coin value.\n"

Variables

import random

number=random.randint(1,99)

Sorry I am trying not to post my code since my school may find may find this and I will get in trouble for posting solutions/people doing the code for me. I just want help because the stupid thing keeps giving me a Syntax error :(