腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
为什么
input
('
str
‘+
int
)
可以
工作
,
而
print
(
int
+ '
str
')
不行
?
python
、
python-3.x
、
typeerror
、
python-2.x
为什么
输入(‘
str
’+
int
)起作用
而
打印(
int
+ '
str
')不起作用 我使用了x= ("enter“+t+ "th value")‘这里type(t) =
int
’‘ 它起作用了,但是,我使用
print
(230 + "k $"),它显示Type-error : unsupported operand type(s) for +:'
int
‘an
浏览 16
提问于2020-04-30
得票数 1
5
回答
为什么
int
(浮动(
Str
))
工作
而
int
(
str
)不
工作
?
python
、
type-conversion
、
int
假设我有一个字符串:当我运行
int
(temp)时Traceback (most recent call last):ValueError: invalid literal for
int
() with base 10: '0.1'
为什么
转换为fl
浏览 0
提问于2018-07-21
得票数 1
回答已采纳
1
回答
为什么
map<pair<
int
,
int
>,
int
>
可以
工作
,
而
unordered_map<pair<
int
,
int
>>
不行
?
c++
、
hash
、
unordered-map
map<pair<
int
,
int
>,
int
>
可以
编译,但unordered_map<pair<
int
,
int
>>的散列函数有问题。后面到底发生了什么?
浏览 3
提问于2021-09-25
得票数 0
8
回答
为什么
Decimal.Divide (
int
,
int
)
可以
工作
,但(
int
/
int
)
不行
?
c#
、
math
、
int
、
divide
为什么
将两个32位整数除以(
int
/
int
)会返回给我0,但是如果我使用Decimal.Divide(),我会得到正确的答案?我绝不是一个喜欢c#的人。
浏览 2
提问于2009-06-25
得票数 115
回答已采纳
3
回答
第一次重复函数
python
、
python-3.x
、
random
random import randint a = randint(0,10) total = a + b guess =
input
()
print
("Correct"= total):
浏览 17
提问于2019-01-22
得票数 0
回答已采纳
1
回答
如何删除括号、逗号和引号
python
、
python-2.7
我的代码是这样
工作
的:('*', '.')*.row = raw_
input
() count = 0 b = "."0):
print
(a,b) * (
int
(
str</e
浏览 1
提问于2016-04-26
得票数 0
回答已采纳
1
回答
"If“语句在函数被召回时被忽略
python
、
python-3.x
、
if-statement
、
input
("Hello. ") try:
print
("What is your desired age?")def secondV(): desiredAge =
浏览 5
提问于2020-12-12
得票数 0
回答已采纳
3
回答
在python中如何检查整数的第一位数是否为零
python
、
string
、
integer
请注意,如果第一个数字不是零,但如果第一个数字为零,则我的代码会
工作
。num =
int
(
input
("enter number: ")) len = len(position)
print
(p
浏览 8
提问于2022-04-05
得票数 -1
1
回答
用Python打印
int
和float
python
、
printing
、
conceptual
考虑到下面的例子,
为什么
有人会选择第一个
而
不是第二个呢?def main(): age =
int
(
input
("
Input
you age:"))
print
("Yourname is " + name + " and you are " +
str
(age) +
浏览 5
提问于2021-12-26
得票数 0
回答已采纳
1
回答
找到回文,不适用于fget
c
我得用保险丝
而
不能用等等。我的代码
可以
用,但是用fget就
不行
。有人知道
为什么
吗?#include <stdio.h>#include <ctype.h> { char
str
[100]; fgets(
str
,
浏览 3
提问于2013-11-25
得票数 1
回答已采纳
2
回答
Python - while循环semi的
工作
方式取决于我在菜单上的开始位置
python
、
while-loop
问题是,选择选项2(减法)然后选择1(加法)会关闭程序,
而
不是询问加法问题。 result =
int
(
input
(" = "))
print
('Correct')else:
print
(
浏览 0
提问于2017-08-01
得票数 0
1
回答
Python中的依赖概率
python
、
probability
if whatCards.endswith("s"): t = False numCards =
int
(raw_
input
("How many cards in your deck"))
浏览 3
提问于2016-03-03
得票数 0
回答已采纳
2
回答
Python-用唯一的数字查找最近的更大的数字
python
、
python-3.x
首先,它看起来很简单,我编写了它的代码,它给了我一个期望的输出,但是对于一些输入,返回一个带重复数字的整数或一个值较高的唯一数字,code a.append(n%10)
浏览 9
提问于2020-01-28
得票数 2
回答已采纳
4
回答
使用Jupyter Notebook中的输入运行python脚本
python
、
input
、
jupyter-notebook
我已经创建了以下名为week1_1.py的Python脚本
input
= sys.stdin.read()a =
int
(tokens[0])
print
(a + b)%run -i week1_1 2 3 D:\Mint_ns\week1_
浏览 0
提问于2018-08-15
得票数 0
1
回答
Python:如何正确修改已使用的全局变量
python
、
if-statement
、
global
: ") global age_goalelse:
print
("You are " +
str
(age) + " years old.")calc = age_goal -
int
(age) + current_yea
浏览 10
提问于2017-08-30
得票数 0
回答已采纳
3
回答
有没有让python的错误消息停止干扰流
python
、
python-3.x
当我执行下面的代码时,是否仍然
可以
让python编译器在不出现错误消息的情况下运行代码?因为我不知道如何区分整数和字符串,不管怎么说,这附近有吗?这是我的代码:
int
(result)
print</em
浏览 0
提问于2018-07-04
得票数 0
回答已采纳
2
回答
打印包含连接字符串的变量时遇到额外字符的问题
python
我一直在尝试打印包含连接字符串的变量时遇到问题,如下所示: num1 =
int
(
input
("Choose a number: "))total_
str
= total_
int
, "is the answer"
print
(total_
str<
浏览 24
提问于2019-01-23
得票数 0
3
回答
把一个数字加在一起给出一个数字
python
print
('Welcome to BirthPath Calculator') Month =
input
('
Input
your month of birth (1-12): ') Day =
浏览 0
提问于2018-10-24
得票数 0
回答已采纳
2
回答
为什么
我不能打印在函数中声明的变量?
python
、
function
(hero_
str
,hero_agi,hero_
int
): hero_
str
=
int
(raw_
input
("> ")) hero_agi =
浏览 1
提问于2015-11-19
得票数 4
回答已采纳
4
回答
删除字符串中的重复字符
java
、
filter
、
text-processing
你好,我正在努力让这部分
工作
,以便当输入是一个字符串,如"aaabbbccdddeef“,输出是"abcdef”。我知道有解决办法,但困扰我的是,这是行不通的,我不知道
为什么
。如果有人能帮助我理解
为什么
这段代码不能
工作
,我会非常感激的。Scanner
input
= new Scanner(System.in);
浏览 4
提问于2020-02-07
得票数 1
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
实时音视频
对象存储
即时通信 IM
活动推荐
运营活动
广告
关闭
领券