Use the function to get user input
(A) Create a script and use the built-in function to obtain a string from the user input, and then display the string that the user just entered.
(B) Add a similarCodeBut this time it is a value, convert it to a value and display it to the user.
# Araw_input ("enter something") # B A = raw_input ("Enter some number") print (INT ())
Loop and number
(A) Write a loop with while and output 0 to 10
(B) Use the range function for the same event.
# AA = 0 while a determines whether the value entered by the user is positive or negative or zero.
I = int (raw_input ('enter some number ')) if I> 0: print 'you input a positive number 'elif I to get a string from the user, print it out by character
STR = raw_input ('enter some string ') while STR: Print STR [0] STR = STR [1:] # Or STR = raw_input ('en TER some string') for I in STR: print I enter five values and use sum.
I = ret = 0 while I obtain the five values and calculate their average value
ret = 0for I in range (5): Str = raw_input ('enter some number'); ret = RET + float (STR) print RET/5 Use raw_input to prompt the user to enter a value ranging from 1 to. If yes, the system displays and exits, otherwise, you will be prompted to enter
loop = 1 while loop: Str = raw_input ('enter 0 ~ A value between 100 '); STR = int (STR) If 0