Python问题帮助

2024-04-25 07:46:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我想要一些关于Python的问题的帮助。有人知道为什么编码语言对某些人来说学习起来如此复杂吗?我需要从现在起一周内得到答复

谢谢


Tags: 语言编码
1条回答
网友
1楼 · 发布于 2024-04-25 07:46:27

在我看来,这并不难。虽然,我确实忘记了这里和那里的事情。如果你是初学者,我建议你使用3.6。我就是从这里开始的。如果您需要一个或多个示例程序,您可以使用以下程序

打印到控制台:

print(‘hello’)

使用变量打印到控制台:

thisIsAString = ‘hello’
print(thisIsAString)

这里有一些条件

TrueBoolean = True
TrueString = ‘Yes’
TrueInt = 1
TrueList = [‘Yes’, 1, True]
if TrueBoolean: 
    print(‘Boolean is True’)
if TrueString == ‘Yes’:
    print(‘String is “Yes”’)
if TrueInt == 1:
    print(‘Int is “Yes”’)
if TrueList == [‘Yes’, 1, True]: # TrueList.contains(INSERT ITEMS HERE) works too.
    print(‘List is true’)

相关问题 更多 >