Advertisement
Guest User

Untitled

a guest
Jan 17th, 2024
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1.  
  2.  
  3. Sure, here's a Python script that prompts for keyboard input to create an eBay auction listing for an iPhone 10 with customizable details:
  4.  
  5. ```python
  6. # Function to prompt for input with a default value
  7. def input_with_default(prompt, default):
  8. user_input = input(prompt)
  9. if user_input == "":
  10. return default
  11. return user_input
  12.  
  13. # Prompt for user input for various listing details
  14. storage = input_with_default("Enter the storage size (e.g., 64GB): ", "64GB")
  15. condition = input_with_default("Enter the condition (e.g., excellent): ", "excellent")
  16. model_number = input_with_default("Enter the model number (e.g., A1865): ", "A1865")
  17. price = input_with_default("Enter the price (e.g., 99.99): ", "99.99")
  18.  
  19. # Create the eBay auction listing title
  20. title = f"iPhone 10 {storage} - {condition.capitalize()} - Model {model_number}"
  21.  
  22. # Create and print the eBay auction listing
  23. description = f"For sale is an iPhone 10 with {storage} of storage, model {model_number}. "
  24. description += f"Please note that the device is in {condition} condition. "
  25. description += f"You can purchase it now for ${price}."
  26.  
  27. print("\n[ eBay Auction Listing ]\n")
  28. print("Title (80 characters max - optimized for eBay SEO):")
  29. print(title)
  30. print("\nDescription:")
  31. print(description)
  32. print("\nBuy It Now:")
  33. print(f"Price: ${price}")
  34. ```
  35.  
  36. This script prompts the user for input values for storage, condition, model number, and price. If no input is provided, it defaults to the values specified. It then constructs the eBay auction listing title and description using the user-provided or default values and prints them.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement