我不知道这是怎么了。您可以跳过整个故事部分,整个故事在MainActivity.java:
和package com.example.test;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LinearLayout content = findViewById(R.id.content);
for (int x=0;x<10;x++) {
RelativeLayout element = new RelativeLayout(this);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 400);
params.setMargins(0, 0, 0, 100); // NOT GETTING THE MARGIN BOTTOM
element.setLayoutParams(params);
element.setBackgroundResource(R.color.green);
content.addView(element);
}
}
}
之间。根据python命令行,第"""
行第344行是不正确的。帮助会有所帮助
"""
答案 0 :(得分:1)
您在print("Total number of words:", len(alice.split())
之后和print("Total number of periods:", alice.count("."))
之后都缺少右括号,因此“不正确”行实际上是解释器试图将其解析为前一个的延续。
print("Total number of words:", len(alice.split()))
print("Total number of sentences:", len(alice.split(".")))
print("Total number of periods:", alice.count(".")))
应该工作。