Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion content/brazilian-portuguese/chatbot/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ date: 2020-02-21T11:45:38-07:00
prereq: "email"
download: ""
draft: false
alwaysopen: false
icon: "fas fa-code"
language: "no-code"
topics: ["ai"]
Expand Down Expand Up @@ -38,4 +39,4 @@ Os chatbots existem há muito tempo. O primeiro chatbot foi criado em 1966 e se
<details close>
<summary>Índice</summary>
{{% children /%}}
</details>
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ As formas mais comuns de operadores booleanos são comparações como menor ou m
| `==` | Igual a | `!=` | Diferente de |

### Desafio 1
Como de costume, use `print` para imprimir seus resultados da seguinte forma: Diferente de
Como de costume, use `print` para imprimir seus resultados:

```python
print(5 + 8 < 10)
print((3 + 5) * 6) == (65 - 17)
print(((3 + 5) * 6) == (65 - 17))
```

A primeira instrução deve retornar <font color="blue">False</font>. E o segundo deve retornar <font color="blue">True</font>.
Expand Down Expand Up @@ -60,7 +60,7 @@ Expressão | Resultado
<font color="blue">True</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">True</font> or <font color="blue">False</font> | <font color="blue">True</font>
<font color="blue">False</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">False</font> and <font color="blue">False</font> | <font color="blue">False</font>
<font color="blue">False</font> or <font color="blue">False</font> | <font color="blue">False</font>

Para resumir, AND (e) requer que ambas as expressões booleanas sejam verdadeiras, enquanto OR (ou) requer apenas que uma das duas expressões booleanas seja verdadeira. Aqui estão mais alguns exemplos:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ print(24 * (8-3) / 6) #imprime 20.0
```

{{% notice note %}}
O computador faz a divisão de números inteiros de maneira diferente da calculadora normal. A divisão de números inteiros excluirá restos ou decimais.
No Python 3, o operador `/` sempre retorna um resultado decimal. Para dividir e obter um número inteiro (descartando o resto), use `//`.

Por exemplo,

`15/4` resulta em `3`
`15,0/4,0` resulta em `3,75`
`15 / 4` resulta em `3.75`
`15 // 4` resulta em `3`

{{% /notice %}}

Expand Down Expand Up @@ -60,7 +60,7 @@ Veja como imprimir um número aleatório entre 1 (inclusive) e 10 (inclusive):

```python
# Esta linha importa a biblioteca necessária
from random import
from random import randint
# Esta linha imprime um número aleatório entre 1 (inclusive) e 10 (inclusive)
print(randint(1,10))
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ print(len(arr)) #imprime 5
```

# isdigit()
Esta função retorna `true` se a string passada como argumento consistir apenas em dígitos; caso contrário, retorna `falso`
Esta função retorna `True` se a string passada como argumento consistir apenas em dígitos; caso contrário, retorna `False`
```python
s = "123";
print s.isdigit() #imprime true
print(s.isdigit()) #imprime True

s = "Olá Mundo";
print s.isdigit() #imprime false
print(s.isdigit()) #imprime False

s = "123Olá"
print s.isdigit() #imprime false pois tem letras junto com dígitos
print(s.isdigit()) #imprime False pois tem letras junto com dígitos
```

# reverse()
Expand Down
1 change: 1 addition & 0 deletions content/english/chatbot/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ date: 2020-02-21T11:45:38-07:00
prereq: "email"
download: ""
draft: false
alwaysopen: false
icon: "fas fa-code"
language: "no-code"
topics: ["ai"]
Expand Down
2 changes: 1 addition & 1 deletion content/english/chatbot/activity-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ weight: 5
We will be using AIML to create our chatbot. AIML stands for **Artificial Intelligence Markup Language**. If you have ever used HTML to make a website, you will find that AIML looks very similar. Before we can start writing AIML, we need to sign up for an account on PandoraBots.

## Pandorabots
Go to [https://www.pandorabots.com/](https://www.pandorabots.com/) and click on **Sign Up**. Enter an email and password to create an account. Alternatevely, you can sign up using an account from Google, Facebook, Twitter, or Github. If prompted, choose the free trial option.
Go to [https://www.pandorabots.com/](https://www.pandorabots.com/) and click on **Sign Up**. Enter an email and password to create an account. Alternatively, you can sign up using an account from Google, Facebook, Twitter, or Github. If prompted, choose the free trial option.
Comment thread
ozhang22 marked this conversation as resolved.
Outdated
Comment thread
ozhang22 marked this conversation as resolved.
Outdated

## Create a new bot
Once you have signed up, you should see a page that looks like this:
Expand Down
4 changes: 2 additions & 2 deletions content/english/python-basics/data-types/booleans.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ As usual, use `print` to print out your results to the following:

```python
print(5 + 8 < 10)
print((3 + 5) * 6) == (65 - 17)
print(((3 + 5) * 6) == (65 - 17))
```

The first statement should return <font color="blue">False</font>. And the second should return <font color="blue">True</font>.
Expand Down Expand Up @@ -60,7 +60,7 @@ Expression | Result
<font color="blue">True</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">True</font> or <font color="blue">False</font> | <font color="blue">True</font>
<font color="blue">False</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">False</font> and <font color="blue">False</font> | <font color="blue">False</font>
<font color="blue">False</font> or <font color="blue">False</font> | <font color="blue">False</font>

To summarize, AND requires both boolean expressions to be true, while OR only requires one of the two Boolean expressions to be true. Here are some more examples:

Expand Down
12 changes: 6 additions & 6 deletions content/english/python-basics/data-types/numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ print(24 * (8-3) / 6) #prints 20.0
```

{{% notice note %}}
The computer does division of integers differently from your regular calculator. Division of integers will exclude remainders or decimals.
In Python 3, the `/` operator always returns a decimal result. To divide and get a whole number (discarding the remainder), use `//` instead.

For example,
For example,

`15/4` makes `3`
`15.0/4.0` makes `3.75`
`15 / 4` makes `3.75`
`15 // 4` makes `3`

{{% /notice %}}

Expand All @@ -40,7 +40,7 @@ Let's try to figure out the answers to the following using Python. Try printing

### Challenge 2

Can you print out this statement? `"527 time 199 is: __"`
Can you print out this statement? `"527 times 199 is: __"`

You will fill in the blank with the answer of what `(527 * 199)` is. If you want to print a string and a number together, you first have to convert the number into a string.

Expand All @@ -60,7 +60,7 @@ Here is how to print a random number between 1 (inclusive) and 10 (inclusive):

```python
# This line imports the library needed
from random import
from random import randint
# This line prints a random number between 1 (inclusive) and 10 (inclusive)
print(randint(1,10))
```
Expand Down
10 changes: 5 additions & 5 deletions content/english/python-basics/functions/built-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ print('The sorted arr is :',arr)
Returns the first occurence of the input(pattern) to the find() provided in the given string.
Comment thread
ozhang22 marked this conversation as resolved.
Outdated
Comment thread
ozhang22 marked this conversation as resolved.
Outdated
```python
str1 = "Hello World"
index = str1.find("World)"
index = str1.find("World")
print(index) #prints 6
```

Expand All @@ -32,16 +32,16 @@ print(len(arr)) #prints 5
```

# isdigit()
This function returns `true` if the string passed as an argument consists of only digits; otherwise it returns `false`
This function returns `True` if the string passed as an argument consists of only digits; otherwise it returns `False`
```python
s = "123";
print s.isdigit() #prints true
print(s.isdigit()) #prints True

s = "Hello World";
print s.isdigit() #prints false
print(s.isdigit()) #prints False

s = "123Hello"
print s.isdigit() #prints false as it has letters along with digits
print(s.isdigit()) #prints False as it has letters along with digits
```

# reverse()
Expand Down
2 changes: 1 addition & 1 deletion content/english/security-fundamentals/what-is-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ weight: 1
## General Security vs. Cyber Security
**Security** on its own is defined as the state of being free from danger or threat. This is the same as the definition of **cyber security** except that cyber security is all about creating a state of being free from danger but in **cyberspace**.

Someone who works in **cybersecurity** is always working on something to make sure that people who use computers are safe when they use the internet in a variety of ways. Some cybers security engineers ensure that users are safe by always being on alert for new vulnerabilities while others do the same job by trying to break programs before hackers can.
Someone who works in **cybersecurity** is always working on something to make sure that people who use computers are safe when they use the internet in a variety of ways. Some cybersecurity engineers ensure that users are safe by always being on alert for new vulnerabilities while others do the same job by trying to break programs before hackers can.

## What is cyberspace?
**Cyberspace** is anywhere that communication happens over a computer network. This can mean when you are interacting with others online in places like social media sites or forums, but it also includes computers talking to each other over the internet or smaller networks for places like a home or office.
Expand Down
3 changes: 2 additions & 1 deletion content/korean/chatbot/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ date: 2020-02-21T11:45:38-07:00
prereq: "이메일 주소"
Comment thread
ozhang22 marked this conversation as resolved.
download: ""
draft: false
alwaysopen: false
icon: "fas fa-code"
language: "no-code"
topics: ["ai"]
Expand Down Expand Up @@ -38,4 +39,4 @@ difficulties: ["beginner"]
<details close>
<summary>목차</summary>
{{% children /%}}
</details>
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ weight: 3
我喜欢饼干。 _______
我最喜欢的颜色是蓝色。 ______

最常见的布尔运算符是比较运算符,如小于或大于。在Python中,如何编写这些运算符如下所示。打印以下结果:fal
最常见的布尔运算符是比较运算符,如小于或大于。在Python中,如何编写这些运算符如下所示。打印以下结果:


| 运算符 | 描述 | 运算符 | 描述 |
Expand All @@ -30,7 +30,7 @@ weight: 3

```python
print(5 + 8 < 10)
print((3 + 5) * 6) == (65 - 17)
print(((3 + 5) * 6) == (65 - 17))
```

第一个陈述应返回<font color="blue">False</font>。第二个应返回<font color="blue">True</font>。
Expand Down Expand Up @@ -61,7 +61,7 @@ print((3 + 5) * 6) == (65 - 17)
<font color="blue">True</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">True</font> or <font color="blue">False</font> | <font color="blue">True</font>
<font color="blue">False</font> or <font color="blue">True</font> | <font color="blue">True</font>
<font color="blue">False</font> and <font color="blue">False</font> | <font color="blue">False</font>
<font color="blue">False</font> or <font color="blue">False</font> | <font color="blue">False</font>

总结一下,AND要求两个布尔表达式都为true,而OR只需要其中一个布尔表达式为true。以下是一些更多的例子:

Expand Down
10 changes: 5 additions & 5 deletions content/simplified-chinese/python-basics/data-types/numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ print(24 * (8-3) / 6) #输出 20.0
```

{{% notice note %}}
计算机在处理整数除法时与常规计算器不同。整数除法将排除余数或小数部分。
在 Python 3 中,`/` 运算符总是返回小数结果。要进行整数除法(舍弃余数),请使用 `//`。

例如,

`15/4` 生成 `3`
`15.0/4.0` 生成 `3.75`
`15 / 4` 生成 `3.75`
`15 // 4` 生成 `3`

{{% /notice %}}

Expand All @@ -40,7 +40,7 @@ print(24 * (8-3) / 6) #输出 20.0

### 小挑战二

你能够打印出这个陈述吗? `"527 乘以 199 等于: __"``
你能够打印出这个陈述吗? `"527 乘以 199 等于: __"`

你可以用(527 * 199)的答案来填写空白处。如果要同时打印字符串和数字,必须首先将数字转换为字符串。

Expand All @@ -60,7 +60,7 @@ print(24 * (8-3) / 6) #输出 20.0

```python
# 这一行代码导入所需的库
from random import
from random import randint
# 这一行代码打印在1(包括)和10(包括)之间的随机数
print(randint(1,10))
```
Expand Down
10 changes: 5 additions & 5 deletions content/simplified-chinese/python-basics/functions/built-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ print('The sorted arr is :',arr)
返回给定字符串中输入(模式)的第一个出现位置。
```python
str1 = "Hello World"
index = str1.find("World)"
index = str1.find("World")
print(index) #输出 6
```

Expand All @@ -32,16 +32,16 @@ print(len(arr)) #输出 5
```

# isdigit()
此函数判断传递的字符串是否仅由数字组成,是则返回 `true`;否则返回 `false`。
此函数判断传递的字符串是否仅由数字组成,是则返回 `True`;否则返回 `False`。
```python
s = "123";
print s.isdigit() #输出 true
print(s.isdigit()) #输出 True

s = "Hello World";
print s.isdigit() #输出 false
print(s.isdigit()) #输出 False

s = "123Hello"
print s.isdigit() #输出 false 因为其中包含字母和数字
print(s.isdigit()) #输出 False 因为其中包含字母和数字
```

# reverse()
Expand Down