IT/Python: Codecademy
Python 3 Conditionals and Control Flow
Last72
2018. 2. 21. 02:05
Comparators
3 < 4
5 >= 5
10 == 10
12 != 13
Boolean operators
True or False
(3 < 4) and (5 >= 5)
this() and not that()
Conditional statements
if this_might_be_true():
print "This really is true."
elif that_might_be_true():
print "That is true."
else:
print "None of the above."
# Complete the if and elif statements! def grade_converter(grade): if grade >= 90: return "A" elif grade >= 80 : return "B" elif grade >= 70: return "C" elif grade >= 65: return "D" else: return "F" # This should print an "A" print grade_converter(92) # This should print a "C" print grade_converter(70) # This should print an "F" print grade_converter(61)
pyg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): word = original.lower() first = word[0] new_word = word[1:len(word)] + first + pyg print new_word else: print 'empty'