driver.find_element_by_css_selector("li.last level1>a>span")
If word is word = input("Enter a word: ")
word_length = len(word)
print("The length of", word,"is ", word_length)
, the output will be:
'back'
I want the output to be:
The length of back is 4
答案 0 :(得分:5)
The best way is to use format
new_list.append({'Mw': Mw_Price[0], 'Price': Mw_Price[1]})
Using C-like statement, note that this is de-emphasised, (but not officially deprecated yet)
print("The length of '{}' is {}".format(word, word_length))
One way is to have your string add with a print("The length of '%s' is %s" % (word, word_length))
and using sep
attribute
'
答案 1 :(得分:0)
You can use <!doctype html>
<html prefix="og: http://ogp.me/ns#">
<head>
<title>HTML5 site</title>
<meta property="og:title" content="The Rock" />
</head>
<body>
</body>
</html>
of a word to include the Python quotation marks (as they appear in e.g. the interactive interpreter); this has the added benefit of working reasonably when quotes are already in the string:
repr