0% found this document useful (0 votes)
16 views3 pages

Python Basics: Print, Variables, Input

The document contains a series of Python print statements demonstrating basic output, including text, escape characters, and multi-line strings. It also covers the concept of variables and values, showing how to assign and change them, as well as how to use user input. Overall, it serves as a tutorial for beginners learning Python syntax and functionality.

Uploaded by

alscks7998
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Python Basics: Print, Variables, Input

The document contains a series of Python print statements demonstrating basic output, including text, escape characters, and multi-line strings. It also covers the concept of variables and values, showing how to assign and change them, as well as how to use user input. Overall, it serves as a tutorial for beginners learning Python syntax and functionality.

Uploaded by

alscks7998
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

# this is a comment. it will not be executed.

print("Hellooooo world!!!")
print('python is fun?')
print("M M")
print('MM MM')
print('MM MM')
print('M M M')
print('M M')
print('M M')
print('M M')
print(' CCC ')
print('C C')
print('C')
print('C')
print('C')
print('C')
print('C C')
print(' CCC ')
print('''with three quotations
we can output
whatever we want
as long as it is
in between quotations''')
print('''anan once said"I hate you !!!"''')
print('anan once said"I hate you !!!"')
print('''I told him, It's Python time''')
print('''She said, 'Python's "great".''')
# --------Escape Characters & special formating
# \n new line
# \t Tab Space
# \\ ads a backslash
# \" adds quote
# \ -> backslash in an escape squander in pyton. it has functions for whatever
comes after it
print('first line \nsecond line')
print('Name:\tMinChan')
print('C:\\folder\\file\\[Link]')
print("she said,\"hello!\"")
print('''Name:\tJohn\nAge:\t17\nGrade:\t11\nSchool: XYZ High''')

#--------Variables and Values


# variables are basically containers that holds values
# such as text="Max" or numbers=4567

price = 10 # price is Variable, 10 is a value


print(price) # no " needed
name = 'Jack' # texts need -> "
print(name)
name = 'Hank' #we can change the content of a variable and assign a new value
print(name)

print('hello my name is',name, 'and i am',price, 'years old')


# we can combine different variables in a print statement using"," or "+"

name = 'MinChan'
school = 'UISG'
fs = 'computer science'
print('I am',name, 'I study at',school, 'My favorite subject is',fs)

#-------------- Inputs
user_name = input('enter ur stupid name: ')
# you can assign an inpupt to a varaiable
print('wowu',user_name,'is realy bad')
# after you have the input, you can manipulate it however needed
#slide 6
f_name = input('Enter your first name: ')
s_name = input('Enter your second name: ')
hobby = input('What do you do in your free time: ')
print(f_name, s_name, 'loves', hobby)

# input numbers

You might also like