print( "ABCDE" ) x = 11 y = 12 z = x + y print( x, "+", y, "+", z ) reply = input( "Enter data to be manipulated: " ) reply = input( "Enter word: " ) w = reply.strip() reply = input( "Enter integer: " ) n = int( reply ) reply = input( "Enter decimal: " ) n = float( reply ) reply = input( "Enter text: " ) words = reply.split() reply = input( "Enter three integers: " ) sa, sb, sc = reply.split() a, b, c = int( sa ), int( sb ), int( sc ) import math reply = input( "Enter radius: " ) r = int( reply ) circumference = 2 * math.pi * r area = math.pi * ( r ** 2 ) reply = input( "Enter integer: " ) n = int( reply ) d1 = n % 10 d2 = n // 10 % 10 reply = input( "Enter text: " ) s = reply.strip() reply = input( "Enter key: " ) key = reply.strip() no_caps_version = s.lower() nbr_occurrences = s.count( key ) first_occurrence = s.find( key ) second_occurrence = s.find( key, first_occurrence + 1 ) slice = s[ first_occurrence : second_occurrence ] import url hangman_url = "http://www.cs.virginia.edu/~cs1112/words/hangman" tough_words = url.get_contents( hangman_url ) reply = input( "Enter text: " ) words = reply.split() reply = input( "Enter integers: " ) numeric_strings = reply.split() integers = [] for s in numeric_strings : i = int( s ) integers.append( i ) sum = 0 product = 1 for i in integers : sum = sum + i product = product * i series = [] for i in range( 0, n ) : value = 2 ** i series.append( value ) strings = [ " are", "You", "doing ", "OKAY" ] canonical_strings = [] for s in strings : s = s.strip().lower() canonical_strings.append( s ) are_all_positive = True for i in integers : if ( i < 0 ) : are_all_positive = False break some_are_positive = False for i in integers : if ( i >= 0 ) : some_are_positive = True break import random i = random.randrange( 0, 100 ) import random s = random.choice( strings ) import random sentence = "" for i in range( 0, 5 ) : word = random.choice( words ) sentence = sentence + word + " " sentence = sentence.strip() import random r = random.randrange( 0, 255 ) g = random.randrange( 0, 255 ) b = random.randrange( 0, 255 ) pixel = ( r, g, b ) key = 88 if key in integers : i = integers.index( key ) else : i = -1 list1 = [ 2, 4, 6, 8 ] list2 = [ 3, 5, 7, 9 ] pairwise_sorted = True n = len( list1 ) for i in range( 0, n ) : w1 = list1[ i ] w2 = list2[ i ] if ( w1 > w2 ) : pairwise_sorted = False break n = len( list1 ) merged_list = [] for i in range( 0, n ) : w1 = list1[ i ] w2 = list2[ i ] merged_list.append( w1 ) merged_list.append( w2 )