Simple and Precise explanation. Thanks a lot!
fruit = {"orange": "a sweet, orange, citrus fruit" "apple": "good for making cider", "lemon": "a sour, yellow cistrus fruit", "grape": "a small, sweet fruit growing in bunches", "lime": "a sour, green cistrus fruit"} # print(fruit) # print (fruit["lemon"] # fruit ["pear"] = "An odd shaped apple" # print(fruit) # fruit ["pear"] = "great with cider" # print(fruit) print(fruit) while true: dict_key = input ("please enter a fruit: ") if dict_key == "quit": break description = fruit.get(dict_key) print(description) print(fruit) veg = {"cabbage": "every child's favorite", "sprouts": "mmmm, lovely", "spinach": can I have some more fruit please"} print(veg) veg.updae(fruit) print(veg) print(fruit.update(veg)) print(fruit) I've tried writing this code again and again, still it gives me an Syntax error...
i am getting a syntax error when trying to add a variable to a dictionary. dog = { 'name': 'kirby', 'hungry': True, 'weight': 9.5, 'age': 10, 'photo': ("^0-0^") } all of the above variables appear to be working fine but when i add 'health': 100, it says i have a syntax error. im confused because it is following the same structure as the previous.
Hi, I would like help with this, it shows syntax error everytime. print("Superhero Quiz") print("3,2,1.....START") print("Question 1, What is Superman's real name?") print("Your options are n/") print("Option A,Clark Kent") print("Option B, Kent Clark") print("Option C, Tony stark") print("Option D, Kal-El") AnswerA=int(input(" Please Enter your option's alphabet you have chosen as your answer") if AnswerA==1: Mark=Mark+1 else: Mark=Mark+0
How do find the syntax error?
I’m trying to define a font and I can’t fix it. It keeps giving me a syntax error. Can you help?
""" Mad Libs is a phrasal template word game which consists of one player prompting others for a list of words to substitute for blanks in a story before reading aloud. Author: Hamzah I """ print ("Mad Libs is starting!") name = input("Enter a name: ") first_adj = input("Enter an adjective: ") second_adj = input("Enter a second adjective: ") third_adj = input("Enter one more adjective: ") first_verb = input("Enter a verb: ") second_verb = input("Enter a second verb: ") third_verb = input("Enter one more verb: ") first_noun = input("Enter a noun: ") second_noun = input("Enter a second noun: ") third_noun = input("Enter a third noun: ") fourth_noun = input("Enter one more noun: ") animal = input("Enter an animal: ") food = input("Enter a food: ") fruit = input("Enter a fruit: ") number = input("Enter an number: ") superhero_name = input("Enter a superhero name: ") country = input("Enter a country: ") dessert = input("Enter a dessert: ") year = input("Enter a year: ") STORY = "This morning I woke up and felt %s because %s was going to finally %s over the big %s %s. On the other side of the %s were many %ss protesting to keep %s in stores. The crowd began to %s to the rhythm of the %s, which made all of the %ss very %s. %s tried to %s into the sewers and found %s rats. Needing help, %s quickly called %s. %s appeared and saved %s by flying to %s and dropping %s into a puddle of %s. %s then fell asleep and woke up in the year %s, in a world where %ss ruled the world." print STORY % (first_adj, name, first_verb, second_adj, first_noun, second_noun, animal, food, second_verb, third_noun, fruit, third_adj, name, third_verb, number, name, superhero, superhero, name, country, name, dessert, name, year, fourth_noun) can y’all find the syntax error in this?
Hi .know matter what I write in my python. I always brings the syntax error stuff.pls get back to me
I sometimes get a syntax error for this. I sometimes it works.......sometimes it doesn't: student_grades = [9.1, 8.8, 7.5] mysum = sum(student_grades) length = len(student_grades) mean = mysum / length print(mean)
@StudySessionYT