What is wrong with my python code. I am receiving this error: Traceback (most recent call last): File "C:/Users/owner/Documents/numberfive.py", line 7, in if age > 18: TypeError: unorderable types: str() > int()
My code is
age= input("Enter your age:")
if age > 18:
print("You can vote.")
else:
print("You can't vote.")
if age > 64:
print ("You're a Senior Citizen...you deserve two votes")
endofprogram = input("Please hit enter to exit from this
program:")
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
What is wrong with my python code. I am receiving this error: Traceback (most recent call...
Python assignment: Write a program that asks for the user's age. Based on their response print "You can vote" (18 years old or older) or "You can't vote" and also whether or not he/she is a senior citizen (over 64). If senior citizen print "You're a Senior Citizen...you deserve two votes"! Use the Idle editor and don't forget the .py extension. Good luck. Your python program will be graded on the following: Execution of the program gives the correct...
Don't understand why code isn't running properly Scottir.UnitB.py D/Python/Scottir UnitB.py (670 File Edit Format Run Options Window Help #Declare a variab i e and initialize it def displayInstructions (1angCode): 3tr . ENGLISHPROMPT = "Please enter your weight in poundョ >> " str.SPANISH PROMPT Por favor entre en su peso en libras > if langCode1: - print ("ENGLISH prompt) print ("SPANISH prompt") print ("Stop") elif langCode2 else: code input ( Enter code for instructions") num code weight = input ("Enter weight...
CAN SOMEONE PLEASE EXPLAN FO ME WHATS WRONG WITH MY CODE WHEN EVEN I RUN IT IT GIVE ME THIS MASSAGE IM USING python BTW Traceback (most recent call last): File "../resource/asnlib/public/RUN.py", line 20, in <module> exec(source_code, dict()) File "<string>", line 60, in <module> NameError: name 'total_rough_sod' is not defined ) from math import pi length = float(input('Enter Course Length:')) width = float(input('Enter Course Width:')) def calculate_smooth_sod(width): grean_area_raduis= (width/2)/2 total_smooth_sod=2*pi*(grean_area_raduis**2) return total_smooth_sod def calculate_sand_trap_area(width): sand_trap_radius=(width/3)/2 sand_trap_area=pi*(sand_trap_radius**2) return sand_trap_area def calculate_rough_sod(length,...
For my computer class I have to create a program that deals with making and searching tweets. I am done with the program but keep getting the error below when I try the first option in the shell. Can someone please explain this error and show me how to fix it in my code below? Thanks! twitter.py - C:/Users/Owner/AppData/Local/Programs/Python/Python38/twitter.py (3.8.3) File Edit Format Run Options Window Help import pickle as pk from Tweet import Tweet import os def show menu():...
I am having trouble figuring out what is wrong with my code. This is the error I get for the last for loop. TypeError: list indices must be integers or slices, not list. This is the code: for line in fhr: ls = line.split(',') customer_list.append([ls[0], ls[1], ls[2], ls[3], ls[4], ls[5], ls[6], int(ls[7]), ls[8], ls[9], ls[10].strip('\n')]) from operator import itemgetter customer_list.sort(key=itemgetter(7), reverse=True) print(customer_list) writepath = './loan-data-output-v1.csv' fwh = open(writepath, 'w', encoding='utf-8') fwh.write('Name' +','+ 'State' +','+'Age' +','+'Annual Income'+','+ 'Loan Type' +','+' Loan...
how would i write my code in Pseudocode? I am pretty much a beginner, therefore this is my first major computer science assignment and im not really understanding the written way of code.. please help and explain. Thank you! this is my working code: # Guess The Number HW assignment import random guessesTaken = 0 names=[] tries=[] print("Welcome! ") question = input("Would you like to play the guessing game? [Y/N]") if question == "N": print("Sorry to see you go so...
Python debug. (Registration error) Hi, can you help me debug the error code, and how can I fix it? Thank you very much! 4 import sqlite: 5 conn sqlite3.connect("OS_Employee.db") 7 withconn: 8 curconn.cursor() try: 10 # Take user input for Employee-ID. Error checks it. Makes sure it's not taken. EmployeeID = input ("Please enter a employee ID: ") First_Nameinput("Please enter the employee's first name: ") Last Nameinput("Please enter the employee's last name: ") Email-input ("Please enter the employee's email: ")...
Hello I need help with python programming here is my code # Trivia Challenge # Trivia game that reads a plain text file import sys def open_file(file_name, mode): """Open a file.""" try: the_file = open(file_name, mode) except IOError as e: print("Unable to open the file", file_name, "Ending program.\n", e) input("\n\nPress the enter key to exit.") sys.exit() else: return the_file def next_line(the_file): """Return next line from the trivia file, formatted.""" line = the_file.readline() line = line.replace("/", "\n") return line def next_block(the_file):...
Python Problem Hello i am trying to finish this code it does not save guesses or count wrong guesses. When printing hman it needs to only show _ and letters together. For example if the word is amazing and guess=a it must print a_a_ _ _ _ not a_ _ _ _ and _a_ _ _ separately or with spaces. The guess has a maximum of 8 wrong guesses so for every wrong guess the game must count it if...
*PYTHON * Help, it say's indention error, what should the fixed indention in the code look like? main.py saved import random 2 import time Python 3.6.8 (default, Jun 11 2019, 01:21:42) [GCC 6.3.0 20170516] on linux File "main.py", line 42 scene10 IndentationError: expected an indented block def scene1(): print("It's 1 am, you're laying in bed drifting off to sleep when you notice your lamp went out") time. sleep (5) print("You get up to investigate, as you know that light bulb...