forked from lokeshsuryawanshi/Python-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeginners_py.py
More file actions
81 lines (60 loc) · 1.28 KB
/
beginners_py.py
File metadata and controls
81 lines (60 loc) · 1.28 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
#print("Hello World")
#Variables
# age = 20
# price = 19.5
# print(age)
#
# first_name = "Mosh"
# is_online = False
# Ex1
# Name = "John Smith"
# age = 20
# patient_type = "New"
# print(Name)
#INPUT FUNCTION
# name = input("What is your name? ")
# print("Hello " + name)
#TYPE of CONVERSIONS
# birth_year = input("Enter you birth year: ")
# #INPUT function always return a string "2003"
# age = 2022 - int(birth_year)
# print(age)
# #functions use for conversion
# int()
# float()
# bool()
# str()
#EX2
# a = float(input("First: "))
# b = float(input("Second: "))
# sum = a + b
# print("Sum: "+ str(sum))
#STRINGS
# course = "Python for Beginners"
# # print(course)
# # print(course.upper())
# # print(course.lower())
# # print(course.find('y'))
# # print(course.replace('for' , '4' ))
# # print(course.find('Python'))
# print('Python' in course)
#ARTHMETIC_OPERATORS
# print(10 + 3)
# print(10 / 3)
# #// print round off value
# print(10 // 3)
# # % gives reminder
# print(10 % 3)
# # ** prints 2 to power 4
# print (2 ** 4)
# x = 10
# # x = x + 3
# x += 3
# print(x)
#OPERATOR
# class Question:
# def __init__(self, q_text, q_answer):
# self.text = q_text
# self.answer = q_answer
# question1 = Question("Wassup bro", "True")
# print(question1.text)