Most line create syntax error any one help me to correct this script and give me

Question:

Repl link:

#!/usr/bin/python3
# -*- coding :UTF-8 -*-
from os import system ,name
import itertool
import threading
import time
import sys
import datetime
from base64 import b64decode , b64encode
from datetime import date
expirydate = datetime.date(2023,11  ,24)
#expirydate = datetime.date(2023,8 ,30)
today=date.today()
green="\033"
neon="\033"
nc="\033"
red="\033"
purple="\033"
yellow="\033"
voilet="\033"
def hero():
    def chalo():
        done = False
        #here is the animation
        def animate():
            for c in itertools.cycle(['|','/', '-','\\']):
                if done:
                    break
                sys.stdout.write('\rhacking in the sikkaking server for next colour--------- ' + c)
                sys.stdout.flush()
                time.sleep(0.1)
            sys.stdout.write('\rDone!    ')
        t = threading.Thread(target=animate)
        t.start()
        time.sleep(0.1)
        done = true
    def chalo1():
        done = False
        #here is the animation
        def animate():
            for c in itertools.cycle(['|','/','-','\\']):
                if done:
                    break
                sys.stdout.write('\rgetting the colour wait-----+ c')
                sys.stdout.flush()
                time.sleep(0.1)
            sys.stdout.write('\rDone!      ')
        t = threading.Thread(target=animate)
        t.start()
        time.sleep(0.3)
        done = true
    def clear():
        #for windows
        if name == 'nt' :
          banner = system('cls')
        #for mac and linux(here,os.name is'pos>
        else:
          banner  = system('clear')
        _  
    def getsum(n):
        sum=0
        for digit in str(n):
            sum+= int(digit)
        return sum
    clear()
    y=1
    newperiod=period
    banner='Detection clear'
    number=[]
    while(y):
       clear()
       system(banner)
       print(f"{yellow}Enter  ",newperiod,"parit">
       current=input()
       print("\n---------Successfully hacked the server----------")
       chalo()
       print("\n---------Suceesfully got the colour")
       primt('\n')
       last2=str(current)
       if(newperiod%2==0):
           sum=getSum(current)
           if(sum%2==0)
               print(newperiod+1," : number ,"
           else
               print(newperiod+1," : number ,"
       else:
           sum=getSum(current)
           if(sum%2==0)
                if(sum%2==0):
               print(newperoid+1," : number,"
           else
               print(newperoid+1," : number,"
       newperoid+=1
       numbers.append(current)
       y=input("Do you wamt to play  : press 1 and continue,'0'to exit:\n")
       if(y==0)
           y=False
           if (len(number)>11):
           clear()
           system('figlet thank you!!')
           print("play on next specified time!!")
           print("-----------current time up ----")
           sys.exit(" \n \n \n contact on telegram"
           #print(number)
           if (expirydate>today)
     now = datetime.datetime.now()
     First = now.replace(hour=13, minute=55,second)
     firstend = now.replace(hour=14, minute=35, second)
     second = now.replace(hour15, minute=25,second)
     secondend = now.replace(hour=17, minute=35,second)
     Third = now.replace(hour=15, minute=55,second)
     thirdend = now.replace(hour16, minute=35,second)
     Final = now.replace(hour=17, minute=55,second)
     finalend = now.replace(hour=18, minute=35,second)
     if(now>Third and now<Thirdend):
            period=320
            hero()
            elif(now):
            peroid=791
            hero()
     elif(now):
            peroid=791
            hero()
    elif(False):
            period=340
            hero()
    elif(False):
            period=360
            hero()
    else:
        banner='raxe.in'
        system(banner)
        #print(f"{yellow}"Hi!! Thanks for buying this hack
        print("Hi! thanks for trying our hack")
        print("----------Your play time----------")
        #print("31st Aug 2021, 11:00 Am- 11:30 Am
        #print("31st Aug 2021, 02:00 pm- 02:30 P>
        print("23rd Sept 2021, 04:00 pm- 04:30 Pm")
        #print("31st Aug 2021, 08:00 PM- 08:30 PM")
        print("please play on the given time,an")
        print("if you think it is an error contact"
        print(" admin on telegram @tusharma3 "
else:
   def clear()
       #for windows
       if name == 'nt':
             =system('cls')
             _
       #for mac and linux(here, os.name is 'pos>
       else:
            =system('clear')
          _
   code="MZXCD"
   code1="BSDF3"
   code2="ASA6"
   test="SD3"
   night="N13"
   nextday="DSDSXS"
   banner='raxe.in'
   rava=0
   now = datetime.datetime.now()
   second = now.replace(hour=0, minute=55,second)
   secondend = now.reace(hour=23, minute55,second)
   Third = now.replace(hour=15, minute=30,second)
   Thirdend = now.replace(hour=18, minute=34,second)
   Final = now.replace(hour=18, minute=25,second)
   Finalend = now.replace(hour=22, minute=35,second)
   if(now>second and now<secondend):
           rava=290
   elif(now>Third and now<Thirdend):
           rava=350
   elif(now>Final and now<Finalend):
           rava=410
   systeam(banner)
   print(f"{neon}*--------*--------*--------*----*"
   print("Your hack has expired--- please contact")
   print(" on telegram ----@tusharma3 for active")
   print("     plan amount --    total limit ")
   print(" 1.  2000 INR ------   1 Day 500 Game")
   print(" 2.  3000 INR ------   2 Day 1000Games")
   print(" 3.  5000 INR ------   7 Day 2100Games")
   ptint("*---------*--------*-------------*--")
   
   
   print("Beware of fraudsters!!!")
   while(True)
   print("My banking name is vusha")
       print(f"{red}After You pay to our UPI ID")     
       print(f"Activate Hack by entering the cor")
       print(f"{green}(UTR) or upi reference number")
       print(f"{neon}To Activate the hack ")
       print(f"if it Does'nt opne contact Me on telegram")
       print(f"{neon}*--------*--------*--------")
       print(f"{red}*---------*--------*--------")
       print("payhere--- UPI :")
       print(f"{yellow}UPI :supper911@ibl")
       print(" if you have already pay to above ")
       print(f"{neon}Enter Your activation code")

      bhai=input

Your code is malformed, and has illegal syntax. have you copied and pasted it without knowing how Python syntax works? I strongly recommend having a very basic overview of it.

I tried to revise it so it’s at least legal, but I can’t understand what it does and I have probably indented if and elses bad. I left comments saying what I did, perhaps you might learn by it and adapt the code to make it perform your task. Here’s what I came up with:

#!/usr/bin/python3
# -*- coding :UTF-8 -*-
from os import system ,name
import itertool
import threading
import time
import sys
import datetime
from base64 import b64decode , b64encode
from datetime import date
expirydate = datetime.date(2023,11  ,24)
#expirydate = datetime.date(2023,8 ,30)
today=date.today()
green="\033"
neon="\033"
nc="\033"
red="\033"
purple="\033"
yellow="\033"
voilet="\033"
def hero():
    def chalo():
        done = False
        #here is the animation
        def animate():
            for c in itertools.cycle(['|','/', '-','\\']):
                if done:
                    break
                sys.stdout.write('\rhacking in the sikkaking server for next colour--------- ' + c)
                sys.stdout.flush()
                time.sleep(0.1)
            sys.stdout.write('\rDone!    ')
        t = threading.Thread(target=animate)
        t.start()
        time.sleep(0.1)
        done = true
    def chalo1():
        done = False
        #here is the animation
        def animate():
            for c in itertools.cycle(['|','/','-','\\']):
                if done:
                    break
                sys.stdout.write('\rgetting the colour wait-----+ c')
                sys.stdout.flush()
                time.sleep(0.1)
            sys.stdout.write('\rDone!      ')
        t = threading.Thread(target=animate)
        t.start()
        time.sleep(0.3)
        done = true
    def clear():
        #for windows
        if name == 'nt' :
          banner = system('cls')
        #for mac and linux(here,os.name is'pos>
        else:
          banner  = system('clear')
        #_ Why was there an underscore here?
    def getsum(n):
        sum=0
        for digit in str(n):
            sum+= int(digit)
        return sum
    clear()
    y=1
    newperiod=period
    banner='Detection clear'
    number=[]
    while(y):
       clear()
       system(banner)
       print(f"{yellow}Enter  ",newperiod,"parit") # missed parentheses
       current=input()
       print("\n---------Successfully hacked the server----------")
       chalo()
       print("\n---------Suceesfully got the colour")
       primt('\n')
       last2=str(current)
       if(newperiod%2==0):
           sum=getSum(current)
           if(sum%2==0): # missed semicolon
                   print(newperiod+1," : number ,") # You didn't close the parentheses
           else: # missed semicolon
               print(newperiod+1," : number ,") # Same as above.
       else:
           sum=getSum(current)
           if(sum%2==0): # missed colon
                if(sum%2==0):
                     print(newperoid+1," : number,") # Again you didn't close the parentheses
               else: # missed colon, bad indentation
                 print(newperoid+1," : number,") # As above
       newperoid+=1
       numbers.append(current)
       y=input("Do you wamt to play  : press 1 and continue,'0'to exit:\n")
       if(y==0): # missed colon
           y=False
           if (len(number)>11): # You need to indent to create a code block (what's inside {} in other programming languages)
             clear()
             system('figlet thank you!!')
             print("play on next specified time!!")
             print("-----------current time up ----")
             sys.exit(" \n \n \n contact on telegram") # parentheses not closed
           #print(number)
           if (expirydate>today): # missed colon
             now = datetime.datetime.now()
             First = now.replace(hour=13, minute=55,second)
             firstend = now.replace(hour=14, minute=35, second)
             second = now.replace(hour15, minute=25,second)
             secondend = now.replace(hour=17, minute=35,second)
             Third = now.replace(hour=15, minute=55,second)
             thirdend = now.replace(hour16, minute=35,second)
             Final = now.replace(hour=17, minute=55,second)
             finalend = now.replace(hour=18, minute=35,second)
             if(now>Third and now<Thirdend):
                    period=320
                    hero()
                    elif(now):
                    peroid=791
                    hero()
             elif(now):
                    peroid=791
                    hero()
            elif(False):
                    period=340
                    hero()
            elif(False):
                    period=360
                    hero()
            else:
                banner='raxe.in'
                system(banner)
                #print(f"{yellow}"Hi!! Thanks for buying this hack
                print("Hi! thanks for trying our hack")
                print("----------Your play time----------")
                #print("31st Aug 2021, 11:00 Am- 11:30 Am
                #print("31st Aug 2021, 02:00 pm- 02:30 P>
                print("23rd Sept 2021, 04:00 pm- 04:30 Pm")
                #print("31st Aug 2021, 08:00 PM- 08:30 PM")
                print("please play on the given time,an")
                print("if you think it is an error contact") # didn't close the parentheses
                print(" admin on telegram @tusharma3 ") # Same as above
        else:
           def clear()
               #for windows
               if name == 'nt':
                     system('cls') # =system('cls') where did the = come from?
                     # _ why an underscore?
               #for mac and linux(here, os.name is 'pos>
               else:
                    system('clear') # =system('clear')
                  # _ All as above
           code="MZXCD"
           code1="BSDF3"
           code2="ASA6"
           test="SD3"
           night="N13"
           nextday="DSDSXS"
           banner='raxe.in'
           rava=0
           now = datetime.datetime.now()
           second = now.replace(hour=0, minute=55,second)
           secondend = now.reace(hour=23, minute55,second)
           Third = now.replace(hour=15, minute=30,second)
           Thirdend = now.replace(hour=18, minute=34,second)
           Final = now.replace(hour=18, minute=25,second)
           Finalend = now.replace(hour=22, minute=35,second)
           if(now>second and now<secondend):
                   rava=290
           elif(now>Third and now<Thirdend):
                   rava=350
           elif(now>Final and now<Finalend):
                   rava=410
           # did you mean system?
           systeam(banner)
           print(f"{neon}*--------*--------*--------*----*"
           print("Your hack has expired--- please contact")
           print(" on telegram ----@tusharma3 for active")
           print("     plan amount --    total limit ")
           print(" 1.  2000 INR ------   1 Day 500 Game")
           print(" 2.  3000 INR ------   2 Day 1000Games")
           print(" 3.  5000 INR ------   7 Day 2100Games")
           # did you mean print?
           ptint("*---------*--------*-------------*--")
           
           
           print("Beware of fraudsters!!!")
           while(True): # Missed colon
             print("My banking name is vusha")
             print(f"{red}After You pay to our UPI ID")     
             print(f"Activate Hack by entering the cor")
             print(f"{green}(UTR) or upi reference number")
             print(f"{neon}To Activate the hack ")
             print(f"if it Does'nt opne contact Me on telegram")
             print(f"{neon}*--------*--------*--------")
             print(f"{red}*---------*--------*--------")
             print("payhere--- UPI :")
             print(f"{yellow}UPI :supper911@ibl")
             print(" if you have already pay to above ")
             print(f"{neon}Enter Your activation code")
      
             bhai=input

I seriously recommend reviewing the code and doing some major refactoring. I suggest trying Sourcery to help achieve clean and pythonic code. It’s free

2 Likes

That part is still illegal, the else is indented incorrectly

1 Like