-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.py
More file actions
33 lines (28 loc) · 980 Bytes
/
HelloWorld.py
File metadata and controls
33 lines (28 loc) · 980 Bytes
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
greeting = 'Hello, World!'
print(greeting)
# This is a simple Python program that prints "Hello, World!" to the console.
# It demonstrates the basic syntax of Python and how to use the print function
# to display output.
# How to run this code:
# 1. Save the code in a file named HelloWorld.py.
# 2. Open a terminal or command prompt.
# 3. Navigate to the directory where the file is saved.
# 4. Run the command: python HelloWorld.py
# 5. You should see "Hello, World!" printed in the console.
word ='apple'
integer = 5
isHappy = True
name_lisr = ['John', 'Doe', 'Jane']
string_number = '123'
print(word)
print(integer)
print(isHappy)
print(name_lisr)
# This code demonstrates the use of different data types in Python.
# It defines a string, an integer, a boolean, and a list, and then prints each of them.
print(word + ' pie')
print(word + string_number)
print(word + ' ' + string_number)
print(word + str(integer))
print(10 + integer)
print(10 + int(string_number))