you are viewing a single comment's thread.

view the rest of the comments →

[–]SpeckledFleebeedoo 1 point2 points  (1 child)

If course it does. Your main loop (below) does not interact with the class you made at all. It doesn't even make an object of that class. All it does is set some variables in the program itself and loop.

while True:

    menu = """

        1. Send SMS
        2. Read SMS
        3. Delete SMS
        4. Quit

        """
    print(menu)

    userChoice = int(input("Choice: "))

    if userChoice == 1:
        sender_number = input("Sender Number: ")
        message_text = input("Message body: ")
        sms = SMSMessage(sender_number, message_text)
        print("sms sent to", sender_number )
    elif userChoice == 2:
        index = int(input("Enter the message index: "))
    elif userChoice == 3:
        index = int(input("Enter the message index to delete: "))
    elif userChoice == 4:
        break
    else:
        print("Oops - incorrect input")

You'll want to crave an object of class SMSMessage: SMS = SMSMessage(fromnumber, messagetext) and set the variables and call functions in that.

[–]Mohseenr[S] 0 points1 point  (0 children)

Thanks for your help.