0% found this document useful (0 votes)
18 views

Python Coding

The document is a Python code that asks the user a series of questions and prints responses based on the user's input. It asks for the user's name, favorite game, description of the weather, how school is, and the costs of lunch items to calculate and print the total lunch cost. Conditionals and input are used to direct the response printed.

Uploaded by

Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Python Coding

The document is a Python code that asks the user a series of questions and prints responses based on the user's input. It asks for the user's name, favorite game, description of the weather, how school is, and the costs of lunch items to calculate and print the total lunch cost. Conditionals and input are used to direct the response printed.

Uploaded by

Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

name=input(“What is your name?

”)

greeting=”nice to meet you”

print(greeting+name)

print(My name is Pedro!)

game=input(“What is your favourite game?”)

if game==”fortnite”:
print(“SAME!!”)

else:
print(game+”is a good game but I prefer fortnite”)

weather=input(“What is the weather like?:”)

if weather==”raining”:
print(“Take an umbrella”)

elif weather==”cold”:
print(“Take a coat!”)

elif weather==”sunny”:
print(“Take sunglasses”)

else:
print(“Have a good day, whatever the weather!”)

school=input(“How is school?:)

if school==”good”:

print(“good good”)

elif school==”bad”:

print(“oh no”)

else:

print(“cool”)

main=int(input(”What is the cost of your main meal?”))

juice=int(input(“What is the cost of your juice?”))

fruit=float(input(“What is the cost of your fruit?))

total=main+juice+fruit

print(“Total for lunch:”,total)

You might also like