CSE 231 Midterm: CSE 231 Exam 1 2014 Fall

13 views7 pages

Document Summary

N = int(n_str) i = 1 while 0 < i < n: i += 1 if i < 4: continue print(i, end = " ") i += 1 else: print(i) # figure 3 # s = "phoenix" cnt1 = 0 cnt2 = 0 for ch in s: if ch in "aeiou": cnt1 += 1 if ch == "x": break if ch not in "aeiou": cnt2 += 1 else: print("else") # line 1 print(cnt1) # line 2 print(cnt2) # line 3. E) none of the above. in_str = input("enter a string:") ############ count = int(input("enter an int:")) # figure 5 # the_sum = 0 index = 1 while index <= len(in_str) 1: # line 1 if in_str[index 1] > in_str[index]: the_sum += int(in_str[index]) index += 1 # line 2 while count > 0: in_str = in_str[0] + in_str[: 1] count = 1 print(the_sum) # line 3 print(in_str) # line 4.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers