Jump to content

COOKIES

addywaddy

i just need helping explain what all the lines do. its for troubleshooting program 

`1243.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

Oh dear... let me type it actually into an editor. Next time please spare us the pictures and give us code we can copy and paste.

 

Here's the code, you're welcome. (Scroll down, another of my posts here is probably the solution to your question)

Spoiler

#phone brand
def question1():
    print("What brand of phone?")
    response = input("iphone, samsung, LG\n")
    if response == "iphone":
        question2()
    elif response == "samsung":
        question3()
    else:
        print ("please resond with a valid brand")
        question1()
    #phone model
        def question2():
            print("what phone model do you have?")
            response = input("6, 7\n")
            if response == "6":
                import i6
            elif response == "7":
                import i7
            else:
                print("Please respond with a valid model")
                question2()

question1()

import time
import random
prob = input("what is the problem?\n")
def yes_no():
    b = input ("has the solution worked")
    if b == "yes":
        print("goodbye")
        time.sleep(2)
        exit()
    if b == "no":
        rand = random.randint(0,100000000)
        print("contact supplier -", rand)

#storage
if "storage" in prob:
    f = open("solutions7.txt")
    sol = f.readlines()
    print(sol[0])
    yes_no()
    k = input("please close to exit")

 

 

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

senor-chang-paper-too-small-to-read[1].jpg

You could use code tags to paste your code here, it is small and overlaps.

Link to comment
Share on other sites

Link to post
Share on other sites

I'm guessing that this is for some school work?

 

Hello

Link to comment
Share on other sites

Link to post
Share on other sites

I'm honestly confused AF.

The first part asks for the brand of the phone and after that it asks for the model number.

But the 2nd part, no idea, it seems incomplete because it doesn't make sense atm.

 

It should give you a solution and then asks if it's good or not, but it gives a random number and as far as i can work out it reads some random stuff from a txt file and does nothing with that.

If you want my attention, quote meh! D: or just stick an @samcool55 in your post :3

Spying on everyone to fight against terrorism is like shooting a mosquito with a cannon

Link to comment
Share on other sites

Link to post
Share on other sites

Here is a commented code version:

Spoiler

#phone brand
def question1(): #define a function to do all this stuff
    print("What brand of phone?") #prints the question
    response = input("iphone, samsung, LG\n") #gets a response as a certain string, one of the three
    if response == "iphone": # starting an if statement
        question2() # if the response is iphone then it proceeeds to execute the later defined question2
    elif response == "samsung": #if it's samsung then it asks a question via a function that is never defined in the code
        question3() # yup, here it is doing what I said
    else: # else already? it didn't do anything for an LG phone?
        print ("please respond with a valid brand") # error message
        question1() # goes back to start
    #phone model
        def question2(): # this hsould have been defined before it got called up there ^^^^
            print("what phone model do you have?") # asks a question
            response = input("6, 7\n") # expects input
            if response == "6": # imports libraries or something based on what model it is
                import i6
            elif response == "7":
                import i7
            else:
                print("Please respond with a valid model") # error handling
                question2()

question1() # begins the entire program

import time # importing stuffs :D
import random
prob = input("what is the problem?\n") #gets input that it never uses
def yes_no(): # starting a function
    b = input ("has the solution worked") # asks a question
    if b == "yes": 
        print("goodbye")
        time.sleep(2) # why sleep here
        exit()
    if b == "no":
        rand = random.randint(0,100000000)
        print("contact supplier -", rand) # hahahaha it gives you a random ticket number, that could result in a collision of numbers, not good

#storage
if "storage" in prob: # oh my bad, it does use this input, looks for the string "storage" in it
    f = open("solutions7.txt")
    sol = f.readlines()
    print(sol[0])
    yes_no()
    k = input("please close to exit") # so this whole tidbit basically opens up a solutions file, reads you the first line? then runs the above function to ask if your problem is fixed

 

If you are asking this question then you should know Python, and if you know Python you shouldn't have to ask this question. All the same, there's that ^^

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, TAHIRMIA said:

I'm guessing that this is for some school work?

 

It has to be, there is no realistic situation where this script would be useful otherwise.

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, LtStaffel said:

It has to be, there is no realistic situation where this script would be useful otherwise.

 

i know. I've done it just that little bit needs to be explained 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, LtStaffel said:

It has to be, there is no realistic situation where this script would be useful otherwise.

 
 

i know. I've done it just that little bit needs to be explained 

sorry i sent old photo. i fixed most of the things you pointed out. but thanks anyways that's everything i need 

Link to comment
Share on other sites

Link to post
Share on other sites

that last part only prints the first line of the txt file, not sure why you would bother even reading a file for one line.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, LtStaffel said:

It has to be, there is no realistic situation where this script would be useful otherwise.

Just making sure, In the UK I am currently doing my GCSE course and we have been told to do something like this with no help as it is an assessed task. If OP is doing the same thing it's kind of stupid to do something like it

Hello

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/21/2017 at 3:36 PM, addywaddy said:

i know. I've done it just that little bit needs to be explained 

what little bit?

 

On 3/21/2017 at 3:06 PM, addywaddy said:

i just need helping explain what all the lines do.

By little bit you mean all of it?
 

On 3/21/2017 at 3:21 PM, LtStaffel said:

If you are asking this question then you should know Python, and if you know Python you shouldn't have to ask this question. All the same, there's that ^^

Sounds like someone wants their homework done...

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×