File tree 1 file changed +13
-10
lines changed
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
# functions practice
2
- print ('----------------------- ---------' )
3
- name = ("input your name : " )
2
+ print ('------return last letter ---------' )
3
+ name = input ("input your name : " )
4
4
5
5
6
6
def last_char (name ):
7
7
return name [- 1 ]
8
8
9
9
10
10
print (last_char (name ))
11
- print ('--------------------------------' )
11
+ # ------------------------------------------
12
+ print ('--------Even or Odd detected------' )
13
+ num = int (input ("Enter your number : " ))
12
14
13
15
14
16
def odd_even (num ):
@@ -17,20 +19,21 @@ def odd_even(num):
17
19
return "odd"
18
20
19
21
20
- print (odd_even (11 ))
21
- print ('--------------------------------' )
22
+ print (odd_even (num ))
23
+ # ------------------------------------------
24
+ print ('---------boolean output-----------' )
22
25
23
26
24
27
def is_even (num ):
25
28
return num % 2 == 0 # True
26
29
27
30
28
- print (is_even (9 ))
29
- print ('----------------------- ---------' )
31
+ print (is_even (num ))
32
+ print ('---------greeting ---------' )
30
33
31
34
32
- def song ():
33
- return "happy birthday song "
35
+ def greeting ():
36
+ return "Thank you very much "
34
37
35
38
36
- print (song ())
39
+ print (greeting ())
You can’t perform that action at this time.
0 commit comments