Answer to Question #187389 in Python for Angelie Suarez

Question #187389

ANG IYONG KAPALARAN sa 2030 PROGRAM

Create a list with following items:

  • Maganda
  • Pogi
  • Cute
  • Panget
  • Sexy
  • Payat
  • Mataba
  • Walang Jowa
  • In a Relationship
  • Married
  • Umaasa sa Ayuda
  • Rich kid
  • Successful
  • Sinungaling parin

(Pwede mong dagdagan ang items)



Then the program should ask for your name and birth year and compute your age. The program should display the randomly picked item on list.

Note: Do not use random.choice() function


Sample output:


Enter your name: Carlo

Enter your Birth Year: 1999


Carlo, Ang iyong edad ay 31 at Ikaw ay Sinungaling parin sa 2030


1
Expert's answer
2021-05-01T08:12:48-0400
import random


items=["Maganda","Pogi","Cute","Panget","Sexy","Payat","Mataba","Walang Jowa",
"In a Relationship","Married","Umaasa sa Ayuda","Rich kid","Successful","Sinungaling parin"]


name=input("Enter your name: ")
birthYear=int(input("Enter your Birth Year: "))
randomItem=items[random.randint(0, len(items)-1)]
age=2030-birthYear
print(f"{name}, Ang iyong edad ay {age} at Ikaw ay {randomItem} sa 2030")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS