could I please get some help! CSE 111 Fall 2017 Project #5 Parts #I & A2 of 3 Du
ID: 3604443 • Letter: C
Question
could I please get some help!
Explanation / Answer
str = ""
while True:
print("1.Enter a string")
print("2.Display the string")
print("3.Display the string 3 times");
print("4.Exit")
ch = int(input("Enter choice :"))
if ch == 4:
break
if ch == 1:
str = input("Enter a string :")
if ch == 2:
if len(str) > 0:
print(str)
else:
print("Please enter a string first")
if ch == 3:
if len(str) > 0:
print(str)
print(str)
print(str)
else:
print("Please enter a string first")
score = int(input("Enter a score :"))
num_toucdown = 0
num_fieldgoal = 0
num_safety = 0
if score > 7:
num_toucdown = score // 7
rem = score % 7
if rem > 3 :
num_fieldgoal = rem//3
rem = rem % 3
if rem > 2:
num_safety = rem//2
greatest_toucdown = score // 7
print("Combination:")
print("Touchdowns :",num_toucdown)
print("Field goals :",num_fieldgoal)
print("Safety :",num_safety)
print("Maximum touchdowns :",greatest_toucdown)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.