Posts

Showing posts with the label syntax

Python : Taberror

Python : Taberror I have one Estonian script, but It gives me error: Sorry: TabError: inconsistent use of tabs and spaces in indentation (function sheet1.py, line 8) [Finished in 0.2s with exit code 1] and code is: import sys import datetime end = False while end == False: def contin01(): print("Kas soovid jätkata?") exit = input("Vali [1] - JAH // Vali [2] - EI: ") if exit[0] == "1": print("********* Beginning of Line ********* ") elif exit[0] == "2": sys.exit() def sina(): nimi = input("Kirjuta enda nimi: ") def guest_name(): Guest_Name = input("Sisesta kliendi nimi: ") def guest_arrival(): Arrival = input("Sisesta kliendi saabumiskuupäev: ") def guest_dep(): Departure = input("Sisesta kliendi lahkumiskuupäev: ") def room(): Room_number = input("Sisesta kliendi toa number ") def special(): req = input("Kirjuta kliendi eri...

Why does it say “Invalid Syntax” When I try to print something in Python? [duplicate]

Why does it say “Invalid Syntax” When I try to print something in Python? [duplicate] This question already has an answer here: When I try to run my Python code in Idle (on a Mac), is says 'invalid syntax' On my quotation marks. Does anyone know why? from goto import goto, label import random tries = 0 r = int(100 * random.random()) + 1 label .guess guess = int(raw_input("Please guess the number between 1 - 100: ")) if guess == r: tries += 1 print "You are correct! It took you " + str(tries) + " tries!" if guess > r: print"Too high... Try again" tries += 1 goto .guess if guess < r: print"Too low... Try again." tries += 1 goto .guess exit Does any one know why this might not work? The line that has an error is this one: print "You are correct! It took you " + str(tries) + " tries!" It is the second quotation mark. This question has been asked before and already has an ...