-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelloworldagain.py
43 lines (29 loc) · 1.53 KB
/
helloworldagain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
print("Hello world! " * 10)
# Print is a function
# Hello World is not python code but is in a python function.
# * is an operator recongized by python.
# 10 is an integer rcognized by python.
message = "Hello Python World!" # This is a variable with a value in ""
print(message)
message = "Hello Python Crash Course World!" # You can change the variable at any time, python will keep track of its current value
print(message)
# Naming and using variables page 21 / 54
# Variable names can contain only letters, numbers, and underscores.
# They can start with a letter or an underscore, but not with a number.
# For instance, you can call a variable message_1 but not 1_message.
# Spaces are not allowed in variable names, but underscores can be used
# to separate words in variable names. For example, greeting_message works,
# but greeting message will cause errors.
# Avoid using Python keywords and function names as variable names;
# that is, do not use words that Python has reserved for a particular pro-
# grammatic purpose, such as the word print . (See “Python Keywords
# and Built-in Functions” on page 489.)
# Variable names should be short but descriptive. For example, name is
# better than n, student_name is better than s_n, and name_length is better
# than length_of_persons_name.
# Be careful when using the lowercase letter l and the uppercase letter O
# because they could be confused with the numbers 1 and 0.
message_v = "Simple Message"
print(message_v)
message_v = "New Simple Message"
print(message_v)