repl.it
@DARKLORD6474/

21(debugged)

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
63
name=input('what is your name?')
age= int(input('how old are you'))
game=input('Do you want to play a game(yes or no)')
if game == 'no':
  print('ok, sure')
if game.lower() == 'yes':
  start=input('                             press enter')
  start=input('Ok.Basically, we will be playing a game called 21.You can say up to three  consecutive numbers starting from one. Just say your last number. for example, if i say "1", u can either say"2, 3 or 4" .If u say 21, u lose.Do u understand?(yes/no)')
  if start.lower() == 'yes':
    print('good')
    start2=input('i will start')
    

    while True():
      qn2=int(input('1'))
      if qn2 == 2 or qn2 == 3:
        qn3=int(input(4))
      if qn2 == 4:
        qn3=int(input(5))
      if qn3 == 5 or qn3 ==6 or qn3 == 7:
        qn4=int(input(8))
      if qn3 == 8:
        qn4=int(input(9))
      if qn4 == 9 or qn4 == 10 or qn4 == 11:
        qn5=int(input(12))
      if qn4 == 12:
        qn5= int(input(13))
      if qn5 == 13 or qn5 == 14 or qn5 == 15:
        qn6=int(input(16))
      if qn5 ==16:
        qn6=int(input(17))
      if qn6 == 17 or qn6 == 18 or qn6 == 19:
        qn7=int(input(20))
        
      if qn6 == 20:
        print('You won.Congratulations')
        game2= input('would you like to play another game?')
        if game2.lower() == 'no':
          print('Sure,' + name)
          print('------------------')
          break
          
          
        
      if qn7 == 21 or qn7 == 22 or qn7 == 23:
        print('You lost. Try again next time')
        game2= input('would you like to play another game?')
        if game2.lower() == 'no':
          print('Sure,' + name)
          print('------------------')
          break
          
    

    
    
    
    
    
    
    
    
    
?