Python time.sleep syntax error
Question: I'm writing a short program that makes it look like the computer is being
hacked.  
I'm going to run it and leave the computer lying around and see how people
react.

However, I am getting this syntax error when I try to use `time.sleep.`  
can someone please help?

    
    
    import time
    print("Connecting to Server...")
    print("Connected!")
    response = input("Proceed with Hack? Y/N: ")
    if response == "Y":
        {
        print("Uploading File: 10%")
        time.sleep(2)
        print("Uploading File: 20%")
        time.sleep(2)
        print("Uploading File: 30%")
        time.sleep(2)
        print("Uploading File: 40%")
        time.sleep(2)
        print("Uploading File: 50%")
        time.sleep(2)
        print("Uploading File: 60%")
        time.sleep(2)
        print("Uploading File: 70%")
        time.sleep(2)
        print("Uploading File: 80%")
        time.sleep(2)
        print("Uploading File: 90%")
        time.sleep(2)
        print("Uploading File: 99%")
        time.sleep(1)
        print("File Uploaded!")
        print("Virus Injection Started...")
        time.sleep(6)
        print("Virus Injection Complete!")
        }
    


Answer: You are using curly braces and they are not python's syntax for `if`
statements, nor for loops (`for, while`). The curly braces are used in other
programming languages. For example C and Java use curly braces to define the
lines of code that belong to an `if` statement, but it is not like that in
Python.

In Python just remember that each line starting with an indentation of 4
spaces will belong to the code executed when entering the `if`. This Python's
syntax also extends to loops, functions definitions, classes definitions...
keep that in mind as well.

For your code remove the curly braces and keep the indentation.

As a simple example:

    
    
    a = 0
    
    if a == 0:
        a = 1 # This line is inside the if statement
        b = 1 # This line is also inside the if statement
    
    a = 2 # Outside the if statement
    

