teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

コード内のif/elif文のインデントを修正しました

2020/05/03 02:08

投稿

pystudent
pystudent

スコア10

title CHANGED
File without changes
body CHANGED
@@ -63,16 +63,15 @@
63
63
 
64
64
  record = input("Do you wish to enter another record? (Y/N) ")
65
65
 
66
- if record == "Y":
66
+ if record == "Y":
67
- anotherRecord = False
67
+ anotherRecord = False
68
68
 
69
- elif record == "N":
69
+ elif record == "N":
70
- anotherRecord = False
70
+ anotherRecord = False
71
- keepAsking = False
71
+ keepAsking = False
72
72
 
73
73
  print("END")
74
74
 
75
-
76
75
  ```
77
76
 
78
77
  ### 試したこと

1

コード内のwhile文のインデントを修正しました

2020/05/03 02:07

投稿

pystudent
pystudent

スコア10

title CHANGED
File without changes
body CHANGED
@@ -55,23 +55,24 @@
55
55
  inputCheck = False
56
56
 
57
57
  else:
58
- output = "Recorded as " + a + b + c + d
58
+ output = a + " (" + b + ") " + "has been recorded as " + c + d + "."
59
59
  print(output)
60
60
 
61
- anotherRecord = True
61
+ anotherRecord = True
62
- while anotherRecord:
62
+ while anotherRecord:
63
63
 
64
- record = input("Do you wish to enter another record? (Y/N) ")
64
+ record = input("Do you wish to enter another record? (Y/N) ")
65
65
 
66
- if record == "Y":
66
+ if record == "Y":
67
- anotherRecord = False
67
+ anotherRecord = False
68
68
 
69
- elif record == "N":
69
+ elif record == "N":
70
- anotherRecord = False
70
+ anotherRecord = False
71
- keepAsking = False
71
+ keepAsking = False
72
72
 
73
73
  print("END")
74
74
 
75
+
75
76
  ```
76
77
 
77
78
  ### 試したこと