Dim no
no = 10
Set obj = CreateObject("Scripting.FileSystemObject")
Do while no = 10
If obj.FolderExists("..\world") Then
obj.CopyFile "..\world", "..\Backups"
WScript.sleep 86400000 '1 day in milliseconds, according to google.
Loop while no = 10
But, as you can see, there is a Do (Line 7). So, how do I fix this?Set obj = CreateObject("Scripting.FileSystemObject")
Dim worldfolder
Dim backupfolder
worldfolder = "..\world"
backupfolder = "..\autosave"
Do
If (obj.FolderExists("..\world")) Then
msgbox "World file found!"
obj.CopyFolder "..\world", "..\autosave"
obj.CopyFile "..\world\*", "..\autosave"
msgbox "Autosave complete!"
Else
msgbox "Error"
Wscript.quit
End If
WScript.sleep 21600000 '6 hours in milliseconds, according to google.
Loop
import math
print("A^2 x 2B x C")
numa = input('What is A? ')
numb = input('What is B? ')
numc = input('What is C? ')
firstanswer = (numb + math.sqrt((math.pow(numb,2)+4*numa*numc))/(2*numa)
secondanswer = (numb - math.sqrt((math.pow(numb,2)+4*numa*numc))/(2*numa)
print("The answer is")
print(firstanswer)
print("or")
print(secondanswer)
secondanswer = (numb - math.sqrt((math.pow(numb,2)+4*numa*numc))/(2*a)
^
SyntaxError: invalid syntax
Looks like that's the problem. I'm gonna guess 'a' should be 'numa'.Code: [Select]secondanswer = .../(2*a)
import math
import __future__ #SORRY I GOT THIS WRONG FIRST TIME
print "A*x^2+B*x+C"
a = input()
b = input()
c = input()
#make sure no invalid stuff is happening, to prevent division
#by 0, sqrt of minus nos
if b ** 2 - 4*a*c < 0 or 2*a ==0:
print "error"
exit()
ans1 = ( -b + math.sqrt( (b ** 2)-(4*a*c) )) / (2*a)
ans2 = ( -b - math.sqrt( (b ** 2)-(4*a*c) )) / (2*a)
print ans1
print ans2
import math
print("A^2 x 2B x C")
numa = input('What is A? ')
numb = input('What is B? ')
numc = input('What is C? ')
firstanswer = (-numb + math.sqrt(numb**2 - 4*numa*numc))/(2*numa)
secondanswer = (-numb - math.sqrt(numb**2 - 4*numa*numc))/(2*numa)
print("The answer is")
print(firstanswer)
print("or")
print(secondanswer)
Fixed your version - the formula was wrong and I think math.pow() broke it
numbertocheck = numberslist[x]
I want to take a number from numberslist with index number 'x', and compare it to this variable: pivot = numberslist[pivotindex]