You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print(f"The sine of {angle_in_radians} radians is: {sine_value}")
542
+
543
+
```
544
+
386
545
### tan()
387
546
388
-
Characters
547
+
**Example:**
548
+
549
+
```python
550
+
import math
551
+
552
+
# Specify the angle in radians
553
+
angle_in_radians = math.radians(60)
554
+
555
+
# Calculate the tangent of the angle
556
+
tangent_value = math.tan(angle_in_radians)
557
+
558
+
# Print the result
559
+
print(f"The tangent of {angle_in_radians} radians is: {tangent_value}")
560
+
```
561
+
562
+
## Characters
389
563
390
564
### isAlpha()
565
+
566
+
`char.isalpha()`
567
+
568
+
Analyse if a single character is alphabetic.
569
+
570
+
```python
571
+
char ='a'
572
+
if char.isalpha():
573
+
print(f"{char} is alphabetic.")
574
+
else:
575
+
print(f"{char} is not alphabetic.")
576
+
```
577
+
391
578
### isAlphaNumeric()
579
+
580
+
`char.isDigit()` and `char.isAlpha()`
581
+
582
+
Checks if char is a number **or** an alphabetic character.
583
+
584
+
**Example:**
585
+
586
+
```python
587
+
# Function to check if a character is alphanumeric
588
+
defis_alphanumeric(char):
589
+
return char.isalpha() or char.isdigit()
590
+
591
+
# Example usage
592
+
test_char ='a'
593
+
594
+
if is_alphanumeric(test_char):
595
+
print(f"{test_char} is alphanumeric.")
596
+
else:
597
+
print(f"{test_char} is not alphanumeric.")
598
+
599
+
```
600
+
392
601
### isAscii()
602
+
603
+
`ord(char) < 128`
604
+
605
+
Checks if character is an ASCII character by checking if the decimal number of the character presented is over 128. If it is over, it is not an ASCII character.
606
+
607
+
```python
608
+
char ='Ö'
609
+
610
+
if0<=ord(char) <128:
611
+
print(f"{char} is an ASCII character.")
612
+
else:
613
+
print(f"{char} is not an ASCII character.")
614
+
```
615
+
393
616
### isControl()
617
+
618
+
`ord(char) < 32 or ord(char) == 127`
619
+
620
+
Checks whether character presented is less than 32 or 127, which represents control characters.
0 commit comments