Python - Input from the user
Write the function definition for the function 'Prompt' to get a 'STRING' input from the user.
Write a script to prompt the question "Enter an STRING:".
Pass the user input in a variable, Say 'x'.
Print the value of 'x' and its type in separate lines.
Input Format for Custom Testing:
It’s a single line that contains string input from the user.
Sample Test Case 1:
Sample Input
STDIN
-----
One
Sample Output
Enter a STRING:
One
<class 'str'>
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'Prompt' function below.
#
#
def Prompt():
# Write your code here
print( 'Enter a STRING:')
x =''
print(input(x))
print(type(x))
if __name__ == '__main__':
Prompt()
ReplyDeleteThanks for your information. very good article.
Best Python Online Course
Best Python Online Course Hyderabad
Python Online Course
Python Online Training In Hyderabad
Python Online Training in India
Best Python Training Online
Python Online Training