Questions tagged [except]

Used for the MS .NET LINQ Except() method and the Python except keyword for exception handling. Use the tag sql-except for questions related to the SQL operator EXCEPT

This tag is used for two different things:

  1. The Microsoft [.NET] Framework [LINQ] Except() method which produces set differences of two sequences.

  2. The [Python] keyword except used for exception handling.

Please use the tag for questions related to the SQL operator EXCEPT

598 questions
-3
votes
1 answer

What is the use of try and except inside a function in python?

I want to know how to use try and except inside a function and what change will it bring to my syntax of code. I was trying to use this tags inside one function but error was coming and my program was not running successfully.
-3
votes
1 answer

Multiple exceptions with python

I am trying to write code that allows me to do 4 things, and I am using try and except. The code is as follows: try: for i in lista: a = url1 + i print(a) wget.download(a, '/Users/******/downloads') except: for i in…
-3
votes
1 answer

Why is this usage of "except" a syntax error in Python 3?

I am trying to write a simple program which will turn lights on and off based on the time of day, in Python 3. I keep on getting a syntax error when try and use except KeyboardInterrupt: in a while loop. This is the error: except…
-3
votes
1 answer

In SQL server, how to fetch column names from a source except target query for which data does not match

I have to find out the name of columns which have different data in a source except target query. Currently when I am executing a Source except Target query, Even if there is only one column value is different, it's returning entire row. My…
Shashank
  • 11
  • 1
-3
votes
1 answer

Except block throwing SyntaxError

I am getting a syntax error for the except I read a lot of other answers, and i tried commenting out everything but the while loop to make sure it wasn't something else. Not sure what's up. from timeit import default_timer start =…
-3
votes
2 answers

Why am I getting syntax error on 'excpet'?

I don't know why i'm getting a syntax error on 'excpet'. All seems well to me! Here's my code: def length(): gameLength = int(input("How many words do you want to play? You can chose anywhere from 1-40: ")) global gameLength if gameLength <= 40 and…
Chris
  • 11
  • 1
  • 1
  • 1
-3
votes
1 answer

Invalid syntax for except ValueError

When i run this code (Python 3.3): counter=0 score=0 import random a = random.randint(1,25) b = random.randint(1,25) c=a+b try: answer=int(input("What is "+str(a)+" + "+str(b)+" ? ") if answer == c: score=score+1 …
jimmy123
  • 3
  • 2
-4
votes
1 answer

what is an exception handler for

I have a script which wants to load integers from a text file. If the file does not exist I want the user to be able to browse for a different file (or the same file in a different location, I have UI implementation for that). What I don't get is…
Windy71
  • 851
  • 1
  • 9
  • 30
-4
votes
1 answer

Errors and Exceptions:C2M5L4_Errors_and_Exceptions-V2

import random participants = ['Jack','Jill','Larry','Tom'] def Guess(participants): my_participant_dict = {} for participant in participants: my_participant_dict[participant] = random.randint(1, 9) if…
-4
votes
4 answers

find out min and max in python 3

5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a…
Haider Ali
  • 1
  • 1
  • 2
-4
votes
2 answers

c# complex objects comparison

public class SecurityMaster : EntityObject { public string BondIdentifier { get; set; } public string Description { get; set; } public EntityCollection SecurityMasterSchedules { get; set} …
Bhaskar
  • 127
  • 1
  • 18
-7
votes
1 answer

Is it possible to avoid integers,floats and special characters using try-except statement only?

I'm trying to make a code that allows only letters. I know we can do this using isalpha() method. But, I'm looking for any other different solutions something like try-except?
Python learner
  • 1,159
  • 1
  • 8
  • 20
-7
votes
1 answer

I need to select IDs by using only INTERSECT / EXCEPT

I have a table with some data: id month price 100 May 2000 100 June 3000 100 July 2500 192 March 2000 192 May 2000 101 May 2000 101 June 3000 100 August 3100 I need to…
SSRaavi
  • 16
  • 7
1 2 3
39
40