473,701 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

syntax error on elif

1 New Member
I've been working on my iPhone to develop an artificial intelligence algorithm that has a syntax error on line 49:

#Sentience

Q = set()
N = []
y = []
n = []
v = []
i = []
X = 0
for N in range(len(N)):
N.append(Q)
y.append(Q)
n.append(Q)
v.append(Q)
i.append(Q)
Q = set(Q)
if len(N) == float('inf'):
break
t = 0
u = []
for u in range(len(u)):
t = t + 1
u.append(t)
if len(u) == float('inf'):
break
z = any(u)
y.insert(z, n)
v.insert(z, i)
def J ():
for n in N:
(y[n]) == y[n] in set(None, set())
T = set(J())
x = N[float('inf')] is set(v in T == all(i) in N(v[i] >= v[next(i)]))
def p ():
X = X + 1
any(x) in X(p(x) is 0) or all(x) in X(p(x) is 1)
if X > 2:
break
output = ""
while True:
l = 11
while l < 126:
l = l + 1
z = chr(l)
p ()
v = p ()
if v == 1:
o = o + z
elif v == 0:
o = o
if o == o + "":
break
print (o)

To what is this error referring:

File "compiler.p y", line 49
elif v == 0:
^
SyntaxError: invalid syntax

Have a good one,

-Oliver
Nov 29 '21 #1
1 15934
khatrivinay1
1 New Member
please format your code properly with proper indentation so I could tell the error. There could be many reasons for this error, and the proper indentation may be the one.
Dec 1 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3352
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. The purpose of the code is simply to delete a record and then redirect back to the page where the delete was started. The code looks like this: elseif ($_GET == "delete") { $query = "delete from product_subcategory2 where product_sku=$_GET and...
1
3238
by: Donald Canton | last post by:
Hi, I'm using Bjarne's book to learn C++ and am stuck on the Calc program in Section 6. Everything works fine except when I try to use istringstream to parse a token from the command line. I thought I followed his instructions on page 118 correctly, but I can't get it to compile without syntax errors in the get_token() function. The whole program follows with the four syntax errors flagged with the text "// SYNTAX ERROR". Thanks in...
5
4511
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by including the -q64 option in xlC compiler. And we are able to link all these libraries to one of the main applications and generate an executable. SKLoader. But, when we try to run this main executable, we are getting the following errors:
2
2260
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a dataset Dim dsAngio As New DataSet 'fill in the dataset by adapter daAngio.Fill(dsAngio, "AngioInfo") Dim ok As Boolean = False
3
16240
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very strange error. In your experience, where I should looking to find the real error? Surely the sintax of glut is correct... gcc.exe -c glut_bitmap.c -o glut_bitmap.o -I"C:/Dev-Cpp/include" -I"../../include" -D__GNUWIN32__ -W -DWIN32 -DNDEBUG...
5
1249
by: orangeDinosaur | last post by:
Here's a section of code: for x in occupants: if x not in uniqueUsers and not in staff: uniqueUsers.append(x) elif x in staff and not in uniqueStaff: uniqueStaff.append(x) When I try to import the module with the function definition that contains this code, I get a syntax error pointing to the 'in' after the 'and not in staff'. I can't figure out why this is bad syntax. Both 'uniqueUsers' and 'staff' are lists.
6
38057
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
6
2573
by: anderson1373 | last post by:
This is giving me a syntax error at the elif statement but i'm not sure why. please help me. miles = 0.0 kilometers = 0.0 def show_menu(): print("1. Convert miles into kilometers.") print("2. Convert kilometers into miles.") print("3. Exit")
2
3522
by: sbtunx | last post by:
hi the problem is a syntax error that highlights pink the "elif" in the program just that. this code is to water mark picture "test.jpg" with the water mark of "model.jpg" with a mark on a white background the cod is: import Image,math model = Image.open("model.jpg") test = Image.open("test.jpg") x=test.size y=test.size im = Image.new("RGB",(x,y))
14
11364
by: calvin dong | last post by:
In my program to brute force all the factors (not including 1) of a number, there is a syntax error in my while loop. The code looks like this. number = raw_input(" Enter a number ") x = 2 coollist = while x <= sqrt(int(number): if number % loop == 0: coollist.append(x) else:
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9083
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5904
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2398
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2035
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.