Results 1 to 2 of 2

Thread: Need help for my python codes

  1. #1
    Join Date
    Jan 2014

    Need help for my python codes

    Hi) I am having some problems in my python codes so please help me out in producing the desired outputs from those code lines.
    Code 1
    Write a program that uses raw_input to prompt a user for their name and then welcomes them. Note that raw_input will pop a dialog box. Enter Sarah in the pop-up box when you are prompted so your output will match the desired output below.

    name = raw_input('Enter your name')
    print 'Welcome'.name
    Desired Output
    Hello Sarah

    [B]Code 2[B]
    Write a program to prompt the user for hours and rate per hour using raw_input to compute gross pay. Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25). You should use raw_input to read a string and float() to convert the string to a number. Do not worry about error checking or bad user data.
    # This first line is provided for you

    hrs = raw_input("Enter Hours:")
    Desired Output


  2. #2
    Join Date
    Aug 2004
    Hint: Do you know what the multiplication operator is in Python (and most other programming languages, for that matter)?
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center