-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpracticee.py
More file actions
61 lines (47 loc) · 832 Bytes
/
Copy pathpracticee.py
File metadata and controls
61 lines (47 loc) · 832 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
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
# 1.
# Print numbers from 1 to x
# num=int(input('enter the value: '))
# x=1
# while num>=x:
# print(x)
# x=x+1
# num=int(input('enter the value: '))
# x=1
# while num>=x:
# print(num)
# num=num-1
#2.
# Print even, odd numbers till N
# num=int(input('enter the value: '))
# x=0
# while num>=x:
# print(x)
# x=x+2
# num=int(input('enter the value: '))
# x=1
# while num>=x:
# print(x)
# x=x+2
# 3.
# Count digits in a number
# num=int(input('enter the value: '))
# cnt=0
# while num>0:
# num=num//10
# cnt=cnt+1
# print(cnt)
# 4.
# Sum of digits
# num=int(input('enter the value: '))
# sum=0
# while num>0:
# rem=num%10
# sum=sum+rem
# num=num//10
# print(sum)
# 5.
# Reverse a number
num=int(input('enter the value: '))
cnt=0
while num>0:
rem=num%10