@zachsanford/

Lesson 1 - Variables & Data Types

Python

No description

fork
loading
Files
  • main.py
main.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Final Fantasy 7

# Creating a variable for a character name
# using a string type
"""
char1 = "Cloud Strife"

# Creating a variable to store health points
# using an integer data type
c1HP = 100

# Creating a variable to store the multiplier
# for XP using a float data type
xpMult = 2.5

# Creating a variable to store the character's
# current XP
c1XP = 0

print(char1)
print(c1HP)
print(xpMult)

# String input
char2 = input("What is the name of your character? >> ")

# Integer input
c2HP = int(input("What is the current max HP for your character? >> "))

# Float input
xpMult2 = float(input("What is the multiplier you would like to use? >> "))

# Character 2's current XP
c2XP = 0

print(char2)
print(c2HP)
print(xpMult2)
"""

# Lesson 2 - IF Statements

# Lesson 3 - While Loops

choice = ""
while choice != "Fight" or "Run":
  print("Enemies approach from the reactor what will you do?")
  choice = input("Will you 'Fight' or 'Run'? ")

  if choice == "Fight":
    print("Battle Begin...")
    break

  elif choice == "Run":
    print("You ran away from the fight")
    print("No XP gained!!!")
    break

  else:
    print("Sorry! Your input was not recognised!")

print("We are out of the loop!")