Question

In: Computer Science

using python 3 1. Two-line input: print a prompt (e.g Enter your first name) and then...

using python 3

1. Two-line input: print a prompt (e.g Enter your first name) and then assign the input to a variable

print ("Enter your first name")# the word prompt is the message the user should see

firstName = input()

print (firstName)

Solutions

Expert Solution

Below are the code for two line input and one line input.

if __name__ == '__main__':

    # Below is the example of two line input:
    print("Enter your first name : ") # Message to user for entering input
    firstName = input() # system input and assign to the variable
    print(firstName) # print the output

    # Below is the example of one line input:
    firstName = input("Enter your first name : ")  # system input and assign to the variable
    print(firstName)  # print the output


Related Solutions

Python Code: Write a program to prompt the user to enter a first name, last name,...
Python Code: Write a program to prompt the user to enter a first name, last name, student ID, number of hours completed and GPA for 5 students. Use a loop to accept the data listed below. Save the records in a text file. Write a second program that reads the records from your new text file, then determines if the student qualifies for Dean’s list or probation. Display the records read from the file on screen with appropriate headings above...
(PYTHON) prompt the user to enter a single-digit num and print that num as follow: 1)...
(PYTHON) prompt the user to enter a single-digit num and print that num as follow: 1) use loops 2) print num in words. Example: 5 is 'five' 3) the number of spaces that go back and forth should equal the num if the user inputs 5, the program prints: five . . . . .five five . . . . . five five and 2 would be: two . .two (the periods(.) are only for demonstration purposes. Don't include it...
#promt the user to enter student name for i in range(0, 3): print ("Enter student's first...
#promt the user to enter student name for i in range(0, 3): print ("Enter student's first and last name") #variable for name name = input() #prompt the user to enter number of book purchased print ("Enter the number of book the student purchased this month") #varibale for number of book book_number = input() book_number = int (book_number) #point = int (point) if (book_number <=0): points = 0 elif (book_number <=3): points = 5 elif (book_number <=6): points = 10 elif...
Write below in Python Get user name from keyboard using input() function (Example username = input("Enter...
Write below in Python Get user name from keyboard using input() function (Example username = input("Enter username:") A: What is your name? B: My name is XXXX. B: What is yours? A: My name is XXXX. A: Nice to meet you. B: Nice to meet you, too. Use print statement and use input() function
Write a C++ Program to print the first letter of your first and last name using...
Write a C++ Program to print the first letter of your first and last name using stars. Note: 1) Using nested For Loop 2) The number of lines is given by user. 3) Using one Outer loop to print your letters. 4) Print the letters beside each other.
Write a C++ Program to print the first letter of your first and last name using...
Write a C++ Program to print the first letter of your first and last name using stars. Note: 1) Using nested For Loop 2) The number of lines is given by user. 3) Using one Outer loop to print your letters. 4) Print the letters beside each other
using python/IDLE (1) Prompt the user to enter a string of their choosing. Store the text...
using python/IDLE (1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. (1 pt) Ex: Enter a sample text: we'll continue our quest in space. there will be more shuttle flights and more shuttle crews and, yes; more volunteers, more civilians, more teachers in space. nothing ends here; our hopes and our journeys continue! You entered: we'll continue our quest in space. there will be more shuttle flights and more...
PYTHON 1- First, initialize the constant NUMS as 3: NUMS=3 2- Print the title of the...
PYTHON 1- First, initialize the constant NUMS as 3: NUMS=3 2- Print the title of the application. >---=== Python Temperature Analyzer ===---< 3- Using a for loop, prompt the user to enter the high and low values for each of NUMS days. The values entered must be between -40 and 40, and high must be greater than low. Print the following messages: > * Read the high value. > Enter the high value for day 1: < (or day 2,...
*******************In Python please******************* (1) Prompt the user to enter a string of their choosing. Store the...
*******************In Python please******************* (1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. (1 pt) Enter a sample text: we'll continue our quest in space. there will be more shuttle flights and more shuttle crews and, yes; more volunteers, more civilians, more teachers in space. nothing ends here; our hopes and our journeys continue! You entered: we'll continue our quest in space. there will be more shuttle flights and more...
Answer using Jupyter Python #Prompt the user to enter a passing grade and store the value...
Answer using Jupyter Python #Prompt the user to enter a passing grade and store the value from #the input() into a variable. #Refer to the variable in problem 2 to complete the following: #Use the if statement to evaluate the only the first element in the #grades list using index notation. #If the grade is passing, display PASSED, otherwise display FAILED. """Problem 1d""" #Use the for statement to iterate on each element in the #grades list (from problem 1a) and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT