repl.it
@olafem/

Bookstore

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# [ ] define and call a function short_rhyme() that prints a 2 line rhyme




# [ ] define (def) a simple function: title_it() and call the function
# - has a string parameter: msg
# - prints msg in Title Case



# [ ] get user input with prompt "what is the title?" 
# [ ] call title_it() using input for the string argument
  



# [ ] define title_it_rtn() which returns a titled string instead of printing
# [ ] call title_it_rtn() using input for the string argument and print the result

def title_it_rtn(msg):
  return msg.title()
  


def book_store(book,price):
  return print("Title:", title_it_rtn(book),"costs $"+price)
  
book_entry= input("Enter book you're searching for: ")
price_entry= input("Enter price of the book: ")
book_store(book_entry,price_entry)